feat(settings): wire policy compiler into registration readiness.#350
Open
enjoyandlove wants to merge 8 commits into
Open
feat(settings): wire policy compiler into registration readiness.#350enjoyandlove wants to merge 8 commits into
enjoyandlove wants to merge 8 commits into
Conversation
…ed#277) Closes JSONbored#296, JSONbored#297, JSONbored#300. - `compileFocusManifestPolicy()` compiles a FocusManifest into a deterministic FocusManifestPolicy with segregated publicSafe and authenticated fields; no reward/wallet/scoring language reaches public output. - `deriveContributionLanes()` maps manifest fields to typed ContributionLanes (preferred/neutral/discouraged) with public-safe guidance text and lane-level warnings. - Exports `__controlPanelRolesInternals` from control-panel-roles.ts to enable direct unit testing of `sanitizeRoleText`. - Adds `test/unit/policy-sanitizer.test.ts` with 46 fixture tests covering path/token/private-term redaction, lane derivation, policy compiler output boundaries, and a 400-iteration property-based sanitizer invariant. 889 tests pass; branch coverage 97.02%. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ss onboarding preview
Signed-off-by: Chan <101856681+enjoyandlove@users.noreply.github.com>
JSONbored
requested changes
Jun 3, 2026
Owner
JSONbored
left a comment
There was a problem hiding this comment.
@enjoyandlove this cannot merge until the branch parses and the PR title is fixed.
A few notes:
- The registration-readiness policy compiler wiring is the right surface for #277.
- The current CI failure is deterministic: TypeScript reports missing braces/commas in
src/signals/focus-manifest.tsandtest/unit/policy-sanitizer.test.ts. - The title also needs to follow this repo's Conventional Commit policy.
Required changes:
- Retitle to
feat(settings): wire policy compiler into registration readiness. - Fix the syntax errors reported by
npm run typecheck. - Keep the OpenAPI artifact fresh after the schema changes.
Validation expected:
npm run typechecknpm run test:coveragenpm run ui:openapi:check- Full
npm run test:ci
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.
Closes #277
Summary
src/signals/onboarding-pack.ts— AddedfocusManifestPolicyToCompilerOutput()adapter that converts the newFocusManifestPolicyshape (from the branch's policy schema) into theRepoPolicyCompilerOutputexpected bybuildRepoOnboardingPackPreview. ImportsFocusManifestPolicyfromfocus-manifest.src/signals/registration-readiness.ts— Wires the full pipeline inbuildRegistrationReadiness:compileFocusManifestPolicy→focusManifestPolicyToCompilerOutput→buildRepoOnboardingPackPreview, producing anonboardingPackPreviewfield onRegistrationReadinessReport. Field isnullwhen nofocusManifestis supplied so all existing callers are unaffected.src/openapi/schemas.ts— AddedonboardingPackPreviewtoRegistrationReadinessSchema; regeneratedapps/gittensory-ui/public/openapi.json.test/unit/registration-readiness.test.ts— 3 new tests: null preview when no manifest is present; preview shape and public-safety invariant when a manifest is provided; unsafe public note stripping through the full pipeline.Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint— skipped (no workflow files changed)npm run typechecknpm run test:coverage— 892 tests pass, branch coverage 97.02% (above threshold)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:check— regenerated and verifiednpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run actionlint— no workflow files were modified.npm run test:workers,build:mcp,test:mcp-pack,ui:lint,ui:typecheck,ui:build— no MCP package or UI files were changed.npm audit— no dependency changes.Safety
focusManifestPolicyToCompilerOutputonly passespublicSafefields;buildRepoOnboardingPackPreviewre-validates viaisFocusManifestPublicSafe. Tests assert output never matches the forbidden-terms pattern.RegistrationReadinessSchemaextended andopenapi.jsonregenerated; new field tested end-to-end.Notes
onboardingPackPreviewisnullwhen nofocusManifestis passed tobuildRegistrationReadiness— all existing call sites remain unaffected.FocusManifestPolicy.publicSafe.*fields only;authenticatedcontext (parse warnings, private note count) is passed asprivateOwnerContextso it stays out of the public preview.buildRepoOnboardingPackPreviewalready enforces a second safety pass viaisRepoOnboardingPackPublicSafe; unsafe text degrades gracefully to a safe fallback markdown string rather than throwing.