feat(settings): define focus-manifest policy schema#339
Merged
JSONbored merged 2 commits intoJun 3, 2026
Conversation
Adds FocusManifestPolicy and compileFocusManifestPolicy() to produce
a normalized, machine-readable schema from a repo focus manifest before
wiring downstream owner or maintainer workflows.
- src/signals/focus-manifest.ts:
- New FocusManifestLanePreference type ("preferred"|"neutral"|"discouraged")
- New sub-types: FocusManifestPolicyContributionLanes,
FocusManifestPolicyDiscouragedWork, FocusManifestPolicyLabelExpectations,
FocusManifestPolicyValidationExpectations
- New FocusManifestPolicy type with explicit publicSafe / authenticated
field split — publicSafe is contributor-facing; authenticated is for
repo owner/maintainer surfaces only
- New compileFocusManifestPolicy(manifest) function — deterministic,
same manifest always produces the same policy
- Private helpers: policyDirectPrLane, policyIssueDiscoveryLane,
policyEntryGuidance, policyReadinessWarnings, policyPublicSummary
- test/unit/focus-manifest.test.ts (14 new tests):
- Minimal: absent manifest → neutral defaults, unconstrained summary
- Malformed: parse warnings forwarded to authenticated.parseWarnings
- Typical: fully specified manifest covers all schema fields end-to-end
- Missing-field: linkedIssuePolicy only, issueDiscoveryPolicy only,
blockedPaths only — each branch verified independently
- Readiness warnings: discouraged-ID-no-paths, required-link-no-guidance
- Public/private separation: maintainerContext absent from publicSafe,
forbidden publicNotes/testExpectations filtered before publicSafe
- Source preservation across repo_file / api_record / none
- Property-based sanitizer (400 iterations, seeded LCG): all publicSafe
text fields pass isFocusManifestPublicSafe across random inputs
JSONbored
approved these changes
Jun 3, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@web-dev0521 this is the right baseline PR for the focus-manifest lane.
A few notes:
- The schema addition is focused and tested.
- This should land before the derived contribution-lane work so the later PR can rebase onto the final policy shape.
- The PR body has the expected issue and validation evidence.
No code changes requested.
Validation expected:
- Keep the settings/unit suite green through merge.
Closed
12 tasks
This was referenced Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FocusManifestPolicytype andcompileFocusManifestPolicy()tosrc/signals/focus-manifest.tspublicSafefields (contributor-facing) fromauthenticatedfields (owner/maintainer-only) — callers route each subset to the correct surface without manual filteringCloses: #296
Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typecheck— cleannpm run test:coveragelocally — 785 pass (1 skipped); pre-existing Windows failures confirmed onmainbefore this branch; coverage stays above 97%npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/signals/focus-manifest.tsand its test file; no public API or MCP surface changedSafety
Notes
Schema structure:
FocusManifestPolicy {
present, source,
publicSafe: {
contributionLanes: { directPrLane, issueDiscoveryLane, preferredEntryPaths }
discouragedWork: { blockedEntryPaths, issueDiscoveryDiscouraged }
labelExpectations: { preferredLabels, linkedIssuePolicy }
validationExpectations: { testExpectations, linkedIssueRequired, linkedIssuePreferred }
entryGuidance: string[] ← isFocusManifestPublicSafe filtered
summary: string ← isFocusManifestPublicSafe guaranteed
},
authenticated: {
readinessWarnings: string[] ← owner/maintainer advisory
parseWarnings: string[] ← forwarded from manifest.warnings
maintainerContext: string[] ← manifest.maintainerNotes, never in publicSafe
}
}
Lane derivation logic:
directPrLaneissueDiscoveryLaneissueDiscoveryPolicy: "encouraged""discouraged""preferred"wantedPaths.length > 0"preferred"issueDiscoveryPolicy: "discouraged""discouraged""neutral""neutral"Test coverage (14 new tests): minimal/absent, malformed JSON, typical full fixture, three missing-field partials, two readiness-warning branches, maintainerContext isolation, forbidden-language injection via publicNotes/testExpectations, source preservation, 400-iteration property-based sanitizer.