Commit Graph
170 Commits
Author SHA1 Message Date
sysadmin 2b6a60a189 Merge pull request 'Add fail-closed branch-identity proofs for author commit/push workflow (Issue #177)' (#181) from feat/issue-177-branch-drift-proofs into master 2026-07-05 15:13:24 -05:00
sysadmin 4dcf8fdfe4 Merge pull request 'Require and validate Controller Handoff sections in workflow final reports (Issue #182)' (#186) from feat/issue-182-controller-handoff-enforcement into master 2026-07-05 14:54:07 -05:00
sysadminandClaude Fable 5 45c5cac2bc Require and validate Controller Handoff sections in workflow final reports
- Upgrade SKILL.md §K compact format to the issue #182 canonical field set
  (Task/Repo/Role/Identity/Issue-PR/Branch-SHA/Files/Validation/Mutations/
  Current status/Blockers/Next/Safety) plus role-specific field lists for
  review/merge, author, and queue/inventory tasks.
- Point the review-pr, merge-pr, and start-issue template handoff lines at
  the exactly-titled Controller Handoff section with their role fields.
- Add review_proofs.assess_controller_handoff(): reports without the exact
  section are 'missing' (downgraded), present-but-partial are 'incomplete'
  with the absent fields listed, and role extras are enforced per role.
- Add TestControllerHandoff (8 tests) including a SKILL.md doc-contract
  test so the documented requirement cannot silently rot.

The handoff supplements the full report; full-report validation rules are
unchanged.

Closes #182

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 15:36:57 -04:00
sysadmin 601c608c58 Merge pull request 'Add repo-name disambiguation and complete-inventory proofs for blind PR review' (#185) from feat/issue-184-repo-name-disambiguation into master 2026-07-05 14:32:34 -05:00
sysadmin e2bccbafee feat(review-workflow): add repo-name disambiguation and complete-inventory proofs (#184) 2026-07-05 15:30:06 -04:00
sysadmin 340b585bfd Merge pull request 'test: isolate CLI output capture with monkeypatch/redirect to fix stdout corruption in full suite (Issue #178)' (#180) from feat/issue-178-fix-test-suite-stdout-capture into master 2026-07-05 14:26:31 -05:00
sysadmin ff4ab500df test: isolate CLI output capture with monkeypatch/redirect to fix stdout corruption in full suite runs (Issue #178)
- Replace raw patch("sys.stdout") and contextlib.redirect_stderr with pytest MonkeyPatch or contextlib redirect scoped to main calls in CLI tests (create_*, prs, python_cli, manage_labels, merge_pr, review_pr).
- Add regression tests in test_review_proofs.py for stdout/stderr remaining usable.
- Ensures normal pytest summary output without junitxml workaround; improves review validation reporting per #173.
- No behavior change to production code or gates.

Refs #178
2026-07-05 15:16:55 -04:00
sysadminandClaude Fable 5 941ada38c2 feat(author-workflow): add fail-closed branch-identity proofs for commit/push (#177)
Adds author_proofs.py, the author-side counterpart of review_proofs.py
(#173), turning the branch-drift incident from PR #176 into fail-closed
gates:

- verify_branch_for_commit: the current branch must equal the intended
  feature branch and may never be a protected branch (master, main,
  develop, development, dev); missing state fails closed.
- detect_branch_drift: any branch or HEAD change between validation time
  and commit time — including an external branch switch in a shared
  worktree, which is treated as an expected event to detect — blocks the
  commit until reconciled.
- verify_push_target: a push requires the local branch, remote target
  branch, and intended issue branch to all match, none protected.
- assess_protected_branch_commit: an accidental protected-branch commit
  must never be pushed, requires repair, and the repair must be reported;
  pushing the accident or silently continuing is a violation.
- build_commit_push_report: final-report block carrying the branch proof
  before commit and before push; any failed proof, drift, or violation
  makes the status blocked.

tests/test_author_proofs.py (27 tests) covers the issue's harness
assertions: commit on master blocked; drift between validation and commit
blocked; push target mismatch blocked; shared-worktree branch switch
detected; repair path cannot silently continue without reporting.

SKILL.md section E and templates/start-issue.md now require recording the
validation-time branch/HEAD, the branch proof before commit, the branch
proof before push, and non-silent accident repair. No review/merge/
permission gate is weakened.

Closes #177

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 15:16:36 -04:00
sysadmin 64dc334a92 Merge pull request 'Add fail-closed proofs for blind PR queue review workflow (Issue #173)' (#176) from feat/issue-173-reviewer-workflow-proofs into master 2026-07-05 14:08:58 -05:00
sysadminandClaude Fable 5 ccc5ef79df feat(review-workflow): add fail-closed proofs for blind PR queue review (#173)
Adds review_proofs.py with pure, fail-closed helpers for the reviewer-side
blind queue workflow:

- verify_pinned_head_checkout: proves HEAD == pinned PR head (full 40-hex,
  no prefix matches) and diff base == PR base; any mismatch blocks
  review/merge.
- assess_inventory_completeness: exhaustive "only PRs found" claims require
  every configured repo listed with stated filters, proven pagination, and
  reported open-PR totals.
- assess_validation_report: validation results are unclaimable unless the
  exact command was stated and its output read; missing pass/fail/skip
  counts, unjustified ignored paths, or unexplained deviation from the
  canonical command downgrade the report to weak.
- assess_self_review_contamination: contamination must be evidence-backed;
  bare same-session claims (either way) yield "unknown" with a
  choose-another-PR-or-stop action, never an assumed verdict.
- build_final_report: distinguishes identity eligibility, author/reviewer
  distinctness, session contamination, validation-on-pinned-head, merge,
  and issue verification; grades "A" only when every proof is present,
  downgrades otherwise, and marks a merge without allowing proofs as a
  blocked violation.

tests/test_review_proofs.py covers all seven harness assertions from the
issue (unchecked-out pinned head blocks merge; multi-repo inventory;
pagination; missing counts flagged weak; evidence-required contamination;
unread output cannot claim validation passed; ignored paths need
justification).

SKILL.md section F and templates/review-pr.md now require the checkout,
inventory, validation-evidence, and contamination proofs and the
distinguished final report. No review/merge safety gate is weakened.

Closes #173

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 14:30:34 -04:00
sysadmin ae7a390495 Merge pull request 'Harden URL redaction in inventory/review failure output (Issue #171)' (#174) from feat/issue-171-redact-raw-urls into master 2026-07-05 13:28:02 -05:00
sysadmin 3ff3affa64 Harden URL redaction in inventory/review failure output (Issue #171) 2026-07-05 14:17:52 -04:00
sysadmin fde8323ad4 Merge pull request 'test: add missing tests for #166 Requirement-5 conflict/staleness scenarios' (#172) from feat/issue-170-add-missing-166-req5-tests into master 2026-07-05 13:09:56 -05:00
sysadmin 0fdc8f5820 test(pr-queue): add missing Requirement-5 conflict/staleness scenario tests for #166
Covers:
1. Stale prior handoff merged but live open
2. Prior open but live closed
3. list_prs and view_pr disagree
4. Merge commit missing after claimed merge
5. Linked issue remains open after claimed merge

Uses live mocks for list/view with staleness fields (#166).
Proves coverage; no src changes or gate weakening.
Refs #170
2026-07-05 14:05:21 -04:00
sysadmin 29f04d003a Merge pull request 'Harden LLM role/task alignment and PR review feedback discovery' (#169) from feat/issue-167-review-feedback-discovery into master 2026-07-05 12:17:43 -05:00
sysadminandClaude Fable 5 a4060c59cc feat: harden LLM role/task alignment and PR review feedback discovery (#167)
- Add gitea_get_pr_review_feedback: read-only MCP-native discovery of
  formal PR review verdicts (APPROVED / REQUEST_CHANGES / COMMENT) with
  latest-state-per-reviewer, blocking change-request and approval
  summaries, reviewed-head vs current-head staleness, dismissed/PENDING
  handling, credential redaction of review bodies, no endpoint URLs
  without the reveal opt-in, and a fail-closed gitea.read gate that
  returns feedback_not_attempted with a structured #142 permission
  report and zero API calls.
- Add task/role guards to gitea_resolve_task_capability: new
  stop_required and task_role_guidance outputs, and a distinct
  address_pr_change_requests author task, so a review/merge request
  under an author profile returns explicit STOP guidance instead of
  silently degrading into author-side mutations, and author-side
  remediation is explicitly barred from review verdicts and merges.
- Add build_validation_report: validation reporting helper that
  distinguishes passed / failed / skipped / not-run, requires the exact
  output for failures, rejects vague statuses, and never implies
  full-suite success unless the full-suite command passed.
- Document task/role alignment (review vs author-fix vs merge vs
  comment workflows with required identity, allowed/forbidden actions,
  and stop conditions), MCP-native review feedback discovery, and
  validation reporting discipline in docs/llm-workflow-runbooks.md.
- Add tests/test_review_feedback.py (22 tests) covering discovery,
  staleness, redaction, URL hiding, fail-closed gating, role guards for
  author/reviewer profiles, and validation report semantics.

Closes #167

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 12:59:54 -04:00
sysadmin 0b6733a7e8 Merge pull request 'Harden PR queue reconciliation against stale or conflicting PR state reports' (#168) from feat/issue-166-pr-queue-reconciliation-harden into master 2026-07-05 11:59:05 -05:00
sysadmin 194301359e feat: harden PR queue reconciliation against stale/conflicting state (#166)
- Add updated_at (list_prs), + merged_at/merge_commit_sha/closed_at/updated_at (view_pr) for staleness detection in tool output and inventory.
- Surface updated_at in gitea_review_pr inventory report.
- Strengthen gitea-pr-review skill steps, _COMMON_WORKFLOWS, _GUIDE_RULES with explicit live reconciliation checklist, 'do not trust prior handoffs', stop on conflict.
- Add dedicated live queue reconciliation runbook section in docs/llm-workflow-runbooks.md.
- Add passthrough tests and assertions for new fields.
- All gates, redaction, author/reviewer separation untouched.
- Tests pass, py_compile clean, diff clean, secret sweep clean.

Closes #166
2026-07-05 12:45:05 -04:00
sysadmin a02d990bc5 Merge pull request 'Allow read-only PR queue inventory under author profiles while preserving hard review/merge gates' (#165) from feat/issue-164-pr-queue-inventory-author into master 2026-07-05 11:38:47 -05:00
sysadmin 88296f0262 fix(pr-queue-inventory): address REQUEST_CHANGES on #165
- Inventory report now includes 'Repository: org/repo' name
- Inventory failure path redacts exception via _redact() per project pattern; no raw exception text leaked
- Added/updated tests covering:
  * repository name present in inventory output
  * inventory failure output is redacted
  * raw exception text does not leak
  * author profiles can perform read-only PR inventory
  * author profiles still cannot approve/request_changes/merge or bypass gates

Preserves all hard gates and author restrictions. No other scope.

Refs #164
2026-07-05 12:29:53 -04:00
sysadmin 56d87db263 Merge pull request 'Update operator runbooks and roadmap docs for Jenkins/GlitchTip MCP status' (#163) from feat/issue-154-update-runbooks-roadmap-docs into master 2026-07-05 11:20:50 -05:00
sysadmin 485ba22c8f Allow read-only PR queue inventory under author profiles while preserving hard review/merge gates 2026-07-05 12:14:26 -04:00
sysadmin 82d6bf286a Merge pull request 'Update Gitea operator guide and skill registry for role-aware task routing' (#162) from feat/issue-144-operator-guide-updates into master 2026-07-05 10:27:58 -05:00
sysadmin e7556f5177 Merge pull request 'feat: structured permission failure reports on gated tools (#142)' (#161) from feat/issue-142-structured-permission-failures into master 2026-07-05 10:24:32 -05:00
sysadmin 7102f27d20 docs: update operator runbooks and roadmap docs for Jenkins/GlitchTip MCP status (#154)
- Updated jenkins-readonly and glitchtip-readonly skills in _PROJECT_SKILLS:
  - Descriptions and notes now use actual server names (jenkins-mcp, glitchtip-mcp)
  - Explain historical -readonly skill names vs registration in mcp-control-plane #55
  - Note gated trigger in jenkins-mcp (see #56), partial filing in glitchtip (see #57)
- Updated docs/safety-model.md: naming note, corrected mutation gating claims for trigger/filing
- Updated docs/architecture/jenkins-readonly-build-status-design.md: naming note, updated Phase 1 to account for gated trigger
- No behavior change to skill status/availability; no secrets exposed
- AC: stale naming explained, actual names documented, Jenkins claims corrected, GlitchTip filing as partial, no over-claiming

Closes #154
2026-07-05 10:59:50 -04:00
sysadmin 67bc31eda5 Merge pull request 'Add task-routing and permission-boundary regression tests' (#160) from feat/issue-145-add-task-routing-permission-boundary-regression-tests into master 2026-07-05 09:58:14 -05:00
sysadmin 916cc7298a Merge pull request 'feat: merge-path compliance harness with mock Gitea target and safety rail (#156)' (#159) from feat/issue-156-compliance-harness into master 2026-07-05 05:31:27 -05:00
sysadmin 2592c6ba7e feat: update operator guide and skill registry for role-aware task routing (#144)
- mcp_get_control_plane_guide now instructs to ALWAYS resolve task capability first (gitea_resolve_task_capability), verify identity/profile, use correct namespace.
- Added hard stops for resolve-first, namespace separation, issue.comment distinct from pr.comment.
- Added/updated skills: gitea-resolve-task-capability (new), and steps/notes in issue-authoring, pr-creation, pr-review, pr-merge, issue-comments to call resolver first.
- Guide docstring and guidance updated for AC: do not hardcode, resolve before act, reviewer for review/merge, author for authoring, issue comments require gitea.issue.comment.
- Tests: 4 new covering guide for author/reviewer, missing issue-comment, static-profile safe next action; EXPECTED_SKILLS updated.
- No secrets/URLs; synthetic tests; no prod behavior change.

Closes #144
2026-07-05 06:29:27 -04:00
sysadminandClaude Opus 4.8 e80508313a feat: integrate mock server with gitea-tools remote resolution and correct verdict parser
- Fix allowedTools options inside run_compliance to support prefixless and prefixed tool access
- Implement sys.executable resolution to allow compliance runner to run safely inside git worktrees
- Dynamically load GITEA_MCP_CONFIG JSON profiles inside gitea_auth.py to support 'mock' remote name
- Implement gitea_url helper inside gitea_auth.py to automatically handle HTTP and HTTPS scheme differences for localhost/loopback mock targets, preventing wrong SSL version errors
- Fix verdict.py escaping mismatch by normalizing stream-json block output structure before matching strings, allowing PR view decision points to be verified correctly

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-05 04:12:13 -04:00
sysadminandClaude Fable 5 abe952b4f1 feat: structured permission failure reports on gated tools (#142)
Every gated denial now carries a 'permission_report' explaining itself:
requested/missing/required operation, active profile and identity (when
already resolved), the profile's allowed operations, which configured
profiles could perform the operation (names only), whether runtime
switching is supported, whether a different MCP namespace/session is
required, and the exact safe next action.

New fail-soft helper _permission_block_report builds the report only
after a gate has refused — it adds guidance to denials, never widens a
permission, performs no network I/O, and degrades to a minimal
fail-closed report if the profile itself cannot be resolved. Wired into
gitea_check_pr_eligibility (and via it gitea_submit_pr_review,
gitea_merge_pr, and the legacy gitea_review_pr wrapper) and into the
issue-comment gate consumers gitea_list_issue_comments and
gitea_create_issue_comment. Input errors (e.g. empty comment body) are
not permission failures and get no report.

Tests cover: missing gitea.issue.comment, author attempting review and
merge, reviewer attempting an authoring operation, unknown/missing
profile fail-closed, switching-enabled guidance, eligible calls carry
no report, and no secret/URL material in any report.

Closes #142

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 03:44:35 -04:00
sysadmin 575da17156 test: add task-routing and permission-boundary regression tests (#145)
- Add 5 new tests covering AC from #145:
  - issue.comment does not imply close_issue
  - pr.comment does not imply issue.comment (via explicit forbidden)
  - reviewer profile cannot push_branch
  - structured guidance for missing merge permission
  - self-approve (self-review gate) blocked with reasons
- Tests are fully synthetic (patches, no live Gitea)
- Updated file docstring
- All 10 tests pass; no behavior changes to prod code

Closes #145
2026-07-05 03:36:47 -04:00
sysadminandClaude Opus 4.8 0947f1ad8a feat: merge-path compliance harness with mock Gitea target and safety rail (#156)
Implements issue #156 after the first skill-comply run reported 100%
compliance while every scenario died at HTTP 401 before the review/merge
decision point.

- compliance/safety.py: loopback-only target rail; refuses live Gitea
  hosts and all non-loopback addresses; IPs validated via ipaddress
  (a string-prefix check would accept DNS names like 127.0.0.1.evil.com);
  no environment override.
- compliance/mock_gitea.py: in-memory loopback mock Gitea (whoami, PR
  view/list, review, merge, branch delete) recording every mutation;
  token via env reference only.
- compliance/specs/gitea-workflow.json + compliance/spec.py: pinned spec
  with all eight critical merge workflow steps required; fail-closed
  loader and drift detection against generated specs.
- compliance/verdict.py: deterministic three-way verdicts. Runs blocked
  before the decision point are INCONCLUSIVE, never compliant; auto-merge
  without explicit approval, blind merge, merge without review, missing
  explicit remote, mutation after auth failure, and live-host mutation
  are NONCOMPLIANT. Positive behaviors (explicit remote, fail-closed on
  auth failure, no live mutations) are recorded.
- compliance/run_compliance.py: orchestrator running three pinned
  scenarios via claude -p against the mock; the competing scenario passes
  only by reaching the decision point and refusing to merge.
- compliance/results/2026-07-05-skill-comply-smoke-test.md: reclassifies
  the original 100% report as smoke-test evidence only.
- tests/test_compliance_harness.py: 43 tests covering the safety rail
  (including dotted-127 bypass attempts), pinned spec, drift, mock
  server, verdicts, scenario config generation, and report rendering.

Closes #156

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-05 03:33:12 -04:00
sysadmin d73d238c37 Merge pull request 'docs: document static dual-namespace Gitea MCP deployment model (#143)' (#158) from docs/issue-143-dual-namespace-model into master 2026-07-05 02:29:21 -05:00
sysadmin fec37cdda9 Merge pull request 'feat: add read-only Gitea task capability resolver tool (#141)' (#157) from feat/issue-141-task-capability-resolver into master 2026-07-05 02:24:36 -05:00
sysadminandClaude Fable 5 2ad876be9f docs: document static dual-namespace Gitea MCP deployment model (#143)
Record the #139 accepted decision as a deployment doc: two static
per-role MCP namespaces (gitea-author, gitea-reviewer), one credential
per process, with dynamic profile switching and dispatcher routing
explicitly rejected for now. Covers rationale (audit clarity, credential
concentration, two-party review boundary, fail-closed behavior),
reference-only client setup via GITEA_MCP_CONFIG/GITEA_MCP_PROFILE,
the 'Auth unsupported' client-badge caveat, and reconnect/reload
requirements after profile/config/code changes. Cross-linked from the
execution-profiles model doc and the workflow runbooks; guarded by
docs-content tests.

Closes #143

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 03:23:40 -04:00
sysadmin 8ef9129e44 feat: add read-only Gitea task capability resolver tool (#141) 2026-07-05 03:21:51 -04:00
sysadmin 3c1ab87e1b Merge pull request 'test: forward-direction issue-comment permission separation (#137 follow-up)' (#140) from tests/issue-137-permission-separation into master 2026-07-05 01:47:26 -05:00
sysadminandClaude Fable 5 9b84ecf592 test: forward-direction issue-comment permission separation (#137 follow-up)
PR #138 added the issue.comment alias and example grants. Add the
forward-direction separation guards the migration decision requires:
gitea.issue.comment never implies issue close, PR review/approve/merge,
or branch push / repo commit; gitea.pr.comment never implies
gitea.issue.comment; the pre-#137 live author op set still fails closed
with the exact operator-facing reason; and the shipped v1/v2 example
configs keep granting issue comments while preserving author/reviewer
role separation.

Refs #137, #139

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-05 02:40:42 -04:00
sysadmin 995bd168c6 Merge pull request 'feat: allow gitea.issue.comment for author/reviewer profiles (#137)' (#138) from feat/issue-137-allow-issue-comments into master 2026-07-05 01:14:37 -05:00
sysadmin 3953b6bdd2 feat: allow gitea.issue.comment for author and reviewer profiles (#137)
- Add aliases 'issue.comment' and 'issue_comment' to GITEA_OPERATION_ALIASES so short names normalize to gitea.issue.comment
- Grant 'issue.comment' (and short) in v2 example profiles for example-author and example-reviewer
- Grant in gitea-mcp.example.json mdcps-reviewer
- Update docs example profiles
- Add test coverage for new aliases and normalization

This enables gitea_create_issue_comment and list for profiles that include it, while preserving fail-closed for others and separation of duties (issue.comment does not imply pr.review etc).

Closes #137
2026-07-05 02:10:18 -04:00
sysadmin 7a6f7257c8 Merge pull request 'feat: support and test MDCPS reviewer identity per #107' (#136) from feat/issue-107-mdcps-reviewer-identity into master 2026-07-04 17:48:49 -05:00
sysadmin 87172229aa feat: support and test MDCPS reviewer identity per #107
- Update v2 test config: mdcps reviewer username '913443' (distinct from author 'jcwalker3'), author 'jcwalker3'
- Adjust TBD negative test to use mutate (post-provisioning)
- Add mdcps-reviewer example to gitea-mcp.example.json and README
- Verifies distinct identities, reviewer cannot create/push, author cannot review/merge

Closes #107

Checks:
- config tests pass
- no secrets in changes (usernames only)
- py_compile and diff clean
2026-07-04 18:35:45 -04:00
sysadmin e88ca1d64b Merge pull request 'feat: complete operator guide and skill registry requirements (#129)' (#134) from feat/issue-129-operator-guide-skills into master 2026-07-04 16:49:45 -05:00
sysadmin 4253f8a52a feat: satisfy Issue #129 operator guide and skill registry requirements 2026-07-04 17:46:19 -04:00
sysadmin cd1d8d71a2 Merge pull request 'fix: redact Gitea web links from PR/issue MCP tool output (#125)' (#133) from feat/issue-125-pr-url-redaction into master 2026-07-04 16:44:24 -05:00
sysadminandClaude Fable 5 c349b98206 docs: note in-place mutation contract on _with_optional_url
Subagent review (read-only) found no blockers; this addresses its one
LOW note by documenting that the helper mutates the passed dict and
must receive a freshly-built one.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-04 17:06:41 -04:00
sysadmin 552f538d97 fix: redact Gitea web links from MCP PR output 2026-07-04 16:46:55 -04:00
sysadmin 2beeeceb90 Merge pull request 'feat: make Gitea MCP profile activation and runtime identity state explicit (#131)' (#132) from feat/issue-131-profile-identity-clarity into master 2026-07-04 13:59:10 -05:00
sysadmin 10a29d1bd5 style: remove trailing whitespace in mcp_server.py and test_runtime_clarity.py 2026-07-04 14:57:21 -04:00
sysadmin a0e7d3360e feat: implement profile activation and runtime identity clarity (#131) 2026-07-04 02:04:07 -04:00