Skip to content

feat(gate): focus-manifest policy as enforceable gate input (#555) - #827

Merged
JSONbored merged 1 commit into
mainfrom
feat/manifest-policy-gate
Jun 17, 2026
Merged

feat(gate): focus-manifest policy as enforceable gate input (#555)#827
JSONbored merged 1 commit into
mainfrom
feat/manifest-policy-gate

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes #555.

What

A repo's focus manifest can declare policy (blocked paths, required-linked-issue, test expectations) but today it's advisory only — CI doesn't enforce it. This adds an opt-in per-repo manifestPolicyGateMode (off|advisory|block, default off). When block, the manifest's declared policy becomes hard blockers through the existing Gittensory Gate check.

Acceptance criterion met: a PR touching a manifest blockedPath (or missing a required linked issue / test evidence) fails the gate when enabled.

How

The guidance builder buildFocusManifestGuidance already emits the three enforceable findings (manifest_blocked_path, manifest_linked_issue_required, manifest_missing_tests) — no new finding logic. The change:

  • isConfiguredGateBlocker (src/rules/advisory.ts): those three codes become blockers when manifestPolicy: block. An independent dimension — deliberately NOT folded into the merge-readiness composite (a test asserts mergeReadiness:block does not promote a manifest-policy finding).
  • Gate path (src/queue/processors.ts) mirrors the slop block: a single shared changed-file load so slop + manifest-policy don't double-fetch (lazy — disabled repos pay nothing), reload the cached manifest via loadRepoFocusManifest, recompute guidance over the changed files, and push only the three enforceable codes into the advisory. A repo with the gate on but no manifest present pushes nothing.
  • isTestPath is exported from rules/advisory for testFileCount.

Config-as-code parity (same PR — no deferred gap)

Wired manifestPolicyGateMode through types / schema / migration 0040 / repositories / openapi / settings-preview (mirroring mergeReadinessGateMode), and .gittensory.yml gate.manifestPolicy in the same change — so it ships complete, not as another #822-style follow-up.

gate:
  manifestPolicy: block   # off | advisory | block

Tests

gate-check-policy.test.ts: each of the three codes × {block→failure, off→success, advisory→success, non-confirmed+block→neutral}, the independent-dimension assertion, the gateCheckPolicy threading, and the end-to-end gate.manifestPolicy: block + manifest_blocked_path acceptance case. focus-manifest.test.ts: gate.manifestPolicy parse / round-trip / bad-value-warn + updated gate-object fixtures.

Verification

migration guard (0001..0040, no dup) · typecheck clean · full suite 1981 passed, 1 skipped (only the pre-existing pngjs visual-agent skip) · openapi regenerated + drift-clean · UI lint clean.

Relates #525/#528 (Phase 1), #551/#552/#822 (gate settings + config-as-code parity).

Add an opt-in per-repo manifestPolicyGateMode (off|advisory|block,
default off). When block, the focus manifest's declared policy becomes
hard gate blockers via the existing Gittensory Gate check: the three
enforceable findings the guidance builder already emits —
manifest_blocked_path, manifest_linked_issue_required,
manifest_missing_tests — gate a confirmed contributor's PR.

Gate-path integration mirrors the slop block: a single shared changed-file
load (slop + manifest-policy no longer double-fetch; lazy so disabled
repos pay nothing), the cached manifest is reloaded via
loadRepoFocusManifest, buildFocusManifestGuidance recomputes over the
changed files, and ONLY the three enforceable codes are pushed into the
advisory. isConfiguredGateBlocker gates them on manifestPolicy: block.
An INDEPENDENT dimension — deliberately not folded into the
merge-readiness composite (a test asserts mergeReadiness:block does not
promote a manifest-policy finding).

Setting wired through types / schema / migration 0040 / repositories /
openapi / settings-preview, plus .gittensory.yml parity in the same
change (gate.manifestPolicy) so it ships without a config-as-code gap.
isTestPath is exported from rules/advisory for the testFileCount.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui e234c8f Commit Preview URL

Branch Preview URL
Jun 17 2026, 11:01 AM

@dosubot dosubot Bot added the size:M label Jun 17, 2026
@ghost

ghost commented Jun 17, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #827 is no longer open. No action.

💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@ghost ghost added the gittensory:reviewed label Jun 17, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@ghost

ghost commented Jun 17, 2026

Copy link
Copy Markdown

gittensory · advisory review

Reviewed 21 changed file(s) — two independent AI reviewers.

Changed files (21)
  • apps/gittensory-ui/public/openapi.json
  • migrations/0040_manifest_policy_gate.sql
  • src/db/repositories.ts
  • src/db/schema.ts
  • src/openapi/schemas.ts
  • src/queue/processors.ts
  • src/rules/advisory.ts
  • src/signals/focus-manifest.ts
  • src/signals/settings-preview.ts
  • src/types.ts
  • test/unit/focus-manifest.test.ts
  • test/unit/gate-check-policy.test.ts
  • test/unit/maintainer-activation.test.ts
  • test/unit/policy-sanitizer.test.ts
  • test/unit/registration-readiness.test.ts
  • test/unit/repo-policy-readiness.test.ts
  • test/unit/self-dogfood-registration-pack.test.ts
  • test/unit/settings-preview.test.ts
  • test/unit/signals-coverage.test.ts
  • test/unit/signals-v2.test.ts (+1 more)

Suggested action: 🔍 Manual review. The changed route's preview could not be captured — review the rendered page manually before merging.

Reviewer A · gpt-oss-120b — recommends ✅ merge
This PR introduces a new focus-manifest policy gate (manifestPolicyGateMode) across the backend, database schema, OpenAPI, and tests, and integrates it into the PR processing pipeline. The implementation is thorough, type‑safe, and covered by unit tests.

Suggestions

  • Update any UI components or docs that expose repository settings to include the new manifestPolicyGateMode option.
  • Verify that the new migration (0040_manifest_policy_gate.sql) is applied in all environments before the code runs.
  • Consider adding an integration test that exercises the end‑to‑end flow with the manifest gate enabled in a real PR scenario.

Worth double-checking

  • If the migration is not applied, older databases will lack the column and cause runtime errors.
  • UI may not yet expose the new setting, leading to confusion for maintainers.

Reviewer B · nemotron-3-120b-a12b — recommends ✅ merge
This PR adds a new enforceable gate for focus-manifest policy (#555). It introduces a manifestPolicyGateMode setting (off/advisory/block) that makes three specific manifest findings (manifest_blocked_path, manifest_linked_issue_required, manifest_missing_tests) actionable as gate blockers when set to 'block'. The implementation includes DB migration, type updates, gate logic adjustments to share file loading between slop and manifest gates, and comprehensive test coverage. The changes are consistent with the existing gating pattern and maintain the public/private boundary (no forbidden terms in new findings).

Suggestions

  • Consider adding a comment in gateCheckPolicy explaining why gateFiles is initialized as null and shared (for future maintainers).
  • In test/unit/gate-check-policy.test.ts, the manifest policy test suite could be simplified by using a table-driven approach for the three finding codes, though the current explicit tests are clear.
  • Verify that loadRepoFocusManifest caching is truly effective for the repeated call in the manifest gate block (though it's likely fine as the function is designed to be cached).

Worth double-checking

  • Ensure the three new finding codes never accidentally contain forbidden terms in their titles/details (manual check shows they're safe).
  • Confirm that the shared file loading doesn't introduce regressions when only one gate is active (the OR condition and per-gate checks look correct).
  • Verify the DB migration works correctly with existing data (default 'off' is safe).

Warning

Could not capture a preview of the changed route(s) — review the rendered page manually before merging.

Before = production · After = this PR's preview deploy.

Route Viewport Before After
/ desktop before desktop after desktop
mobile before mobile after mobile

@JSONbored
JSONbored merged commit 07d7dae into main Jun 17, 2026
20 checks passed
@JSONbored
JSONbored deleted the feat/manifest-policy-gate branch June 17, 2026 11:02
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 35.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.55%. Comparing base (2ff4d71) to head (e234c8f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/queue/processors.ts 20.00% 10 Missing and 2 partials ⚠️
src/rules/advisory.ts 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #827      +/-   ##
==========================================
- Coverage   96.64%   96.55%   -0.09%     
==========================================
  Files          97       97              
  Lines       14072    14091      +19     
  Branches     5130     5141      +11     
==========================================
+ Hits        13600    13606       +6     
- Misses         95      105      +10     
- Partials      377      380       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(github-app): focus-manifest policy as gate input

1 participant