Skip to content

Require a Trusted account on a linked closing issue - #2338

Merged
JacobStephens2 merged 8 commits into
mainfrom
issue-2337
Nov 27, 2026
Merged

JacobStephens2 merged 8 commits into
mainfrom
issue-2337

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

before a session reads a linked closing issue
  if an account that is not a Trusted account edited the title or body since the run started
    stop with the existing message
  if the author is not a Trusted account, or any earlier edit was by an account that is not one
    stop, and start no further session
  write .thirdshift-review-input.md

A Review run, a Fix run, or a pull-request Custom process does this, including one started as a Pass. Once the Pass has selected a pull request, that stop exits the command and does not take the next candidate. A Claim or an issue reservation still skips the candidate before selection.

closing_issue_trust in src/trust.rs is the decision, on the existing Reads adapter. The run calls it from ClosingIssues::check_known and from GitHub::review_input, before the review input is written.

Evidence

Execution evidence

  • Before: cargo test --test review_run untrusted_closing_issue_author_stops_before_the_issue_is_used -- --test-threads=8

The run still reached the review-input symlink, so the test failed:

thread 'untrusted_closing_issue_author_stops_before_the_issue_is_used' panicked at tests/review_run.rs:1639:9:
thirdshift: review input .../.thirdshift-review-input.md is a symlink; refusing to follow it
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 48 filtered out; finished in 2.47s

After: the same command

test untrusted_closing_issue_author_stops_before_the_issue_is_used ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 49 filtered out; finished in 2.43s

The foreign-repository reservation test failed once the trust read called gh api repos/acme/other/issues/7. The fake only switched state when acme/other was its own argument.

  • Before: cargo nextest run --no-fail-fast, test closing_issue_reservations_are_read_from_the_issues_repository
thirdshift: gh api repos/acme/other/issues/7 failed: fake gh: unknown repo acme/other
left: Some(1)
right: Some(0)

After: cargo test --test review_pass closing_issue_reservations_are_read_from_the_issues_repository -- --test-threads=8

test closing_issue_reservations_are_read_from_the_issues_repository ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 33 filtered out; finished in 1.96s

This review round added post-prepare coverage for the new stop. The Spec reviewer's test, run as written, passes on this branch, and a Self-merge twin proves the clean-stop predicate matters:

  • cargo test --test review_run -- unusable_closing_issue_seen_at_push_stops_push_and_comment - 1 passed. A body edit dated 2020-01-02 appears at push; the run stops with #7 body edited by an account that is not a Trusted account; starting no further session, posts no comment and pushes nothing.
  • cargo test --test review_merge -- unusable_closing_issue_during_self_merge_repair_stops_without_merging - 1 passed. With trust::UnusableClosingIssue temporarily dropped from ClosingIssues::is_untrusted_closing_issue, the same test failed (isDraft true, expected false), so the test reaches the predicate site it guards. The mutation was reverted.

cargo test --bin thirdshift trust::tests passed (23). The targeted closing-issue filters across review_run, review_pass, fix_run and fix_pass passed. cargo fmt --check and cargo clippy --all-targets -- -D warnings are clean.

scripts/affected-tests main passed npm test --prefix site (74 tests, including docs:check), then stopped at plan_usage::fleet_plan_usage_groups_shared_logins_and_keeps_an_offline_peer_cached, which recorded the host muse at /home/jacob/.local/bin/muse. That test is not in this diff, and the same failure was recorded on the earlier head. The remaining site checks ran directly: cargo test --test share_card --test site_deploy passed, cargo test --bin thirdshift prompts_page passed (16), and cargo test --test review_merge passed (15 passed, 2 ignored). A full cargo nextest run --no-fail-fast was stopped after 30 minutes without finishing, so the full local suite beyond the checks above is unverified; CI covers the pushed head.

Visual evidence

Copy only, at desktop 1440x900. Layout did not change, so there is no separate mobile capture. The new sentence is on /, /how-it-works/, /architecture/ and /docs/, and not on /prompts/. The home tagline is still Your issues become pull requests overnight. This review changed no rendered file, so these captures stay.

Before - home Fix copy, desktop 1440x900

Before home Fix copy at desktop 1440x900

After - home Fix copy, desktop 1440x900

After home Fix copy at desktop 1440x900

Before - home Review copy, desktop 1440x900

Before home Review copy at desktop 1440x900

After - home Review copy, desktop 1440x900

After home Review copy at desktop 1440x900

Before - how-it-works Fix copy, desktop 1440x900

Before how-it-works Fix copy at desktop 1440x900

After - how-it-works Fix copy, desktop 1440x900

After how-it-works Fix copy at desktop 1440x900

Before - docs Fix runs, desktop 1440x900

Before docs Fix runs at desktop 1440x900

After - docs Fix runs, desktop 1440x900

After docs Fix runs at desktop 1440x900

Before - architecture Trusted accounts, desktop 1440x900

Before architecture Trusted accounts at desktop 1440x900

After - architecture Trusted accounts, desktop 1440x900

After architecture Trusted accounts at desktop 1440x900

Unaddressed findings

Standards

Repeated trust reads in ClosingIssues::check_known (src/delivery.rs lines 1255-1260) and the two handovers (src/delivery.rs lines 1340-1343, src/processes/review.rs lines 300-303): the since-start loop, the closing_issue_trust loop, and GitHub::review_input each read the same edit histories. I left the reads as they are. src/trust.rs keeps one decision per public function (issue_trust, ticket_trust, closing_issue_trust), and check_known runs the since-start decision for every retained issue before the author/any-edit decision for any of them, so merging the loops into one read needs a new combined decision in src/trust.rs and changes which read error surfaces first in a security gate. Repeated fresh reads at each boundary are the existing ClosingIssues pattern: check re-reads the closing-issue list and edit histories before and after each Step, session, Repair, Resume, push and Self-merge. The finding claims no wrong result. Not a Spec or Day shift decision.

refuse_unusable_closing_issue (src/delivery.rs lines 1297-1298) calls trust::closing_issue_trust(&GitHub::new(), issue) instead of a &GitHub a caller already holds. I left that as it is. The sibling gate does the same thing: no_untrusted_edit_since (line 1278) calls trust::untrusted_edit(&GitHub::new(), issue, Some(started)). GitHub is a stateless wrapper around the gh binary. .agents/skills/thirdshift-codebase-design/SKILL.md says one adapter is a hypothetical seam, and not to introduce a seam unless something actually varies across it. GitHub::review_input passes self only because that function is already a method on GitHub. The finding does not claim a wrong result. Not a Spec or Day shift decision.

Addressed instead: the review_input doc comment now names the UnusableClosingIssue error mode, and the Trusted-account row in docs/code-navigation.md now lists tests/review_pass.rs and tests/fix_pass.rs.

Spec

None. The one Spec finding (no post-prepare test reached the new stop) is addressed by the two tests above.

Security review outcome

  • Security review on grok failed; see Session trace

Review coverage

Standards and Spec each read every file changed by the four branch commits under review, including site/docs/index.html (read as hunks, not excluded as generated output; npm run docs:check could not run in the reviewers' worktree for missing site/node_modules, and passes after npm ci --prefix site). Unread changed files: tests/review_merge.rs, added after the review to address the Spec finding, so neither reviewer read it. Both reviewers read changed hunks and bounded ranges rather than every remainder of the largest files; their reports in the Session trace list the ranges.

Merge Danger

Door: two-way

Reverting the change restores the since-start edit check and lets a run use a linked closing issue again.

Blast Radius: Review, Fix, and pull-request Custom processes

A linked closing issue whose author is not a Trusted account, or whose title or body an account that is not one has edited, stops the run before a session sees the issue. Passes that already selected that pull request stop instead of taking the next candidate.

Closes #2337

Built with muse Muse Code 1.4.25 (1.4.25-R9361.1) · muse-wonder-full-1.0 · max

A Review run, a Fix run, or a pull-request Custom process, including one started as a Pass, refuses a linked closing issue whose author is not a Trusted account, or whose title or body an account that is not one has edited, before writing the review input or starting a session. An edit since the run started still fails first, with the existing message.
The Fix run test had copied the Review run's clone-and-push helper. Scenario::commit_review_input_symlink uses the existing seed push. ClosingIssues comments now name both stop conditions; the clean-stop predicate keeps its name.
Review Pass admission already sent acme/other as its own gh argument. The trust read calls gh api repos/acme/other/issues/7, so the fake has to match the repository inside that path. A held issue on the other repository still skips.
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Delivery completed on agent-authored or reviewed head a2ba006.

1 similar comment
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Delivery completed on agent-authored or reviewed head a2ba006.

@JacobStephens2 JacobStephens2 added the in-progress A Claim: thirdshift has taken this issue label Nov 26, 2026
Rename closing_issue_use/ClosingIssueUse to closing_issue_trust/UntrustedClosingIssue, parallel to issue_trust/UntrustedIssue, and is_untrusted_edit to is_untrusted_closing_issue now that an untrusted author with no edit also stops the run. Index closing_issue_trust and its ClosingIssues/review_input enforcement points in docs/code-navigation.md. No behaviour change.
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Review run. Pushed fixes to issue-2337 at 00a52ea. Spec axis used the linked closing issues.

Review complete. Spec (linked closing issue #2337, not the PR body alone) passes with no findings. Standards raised 4 judgement calls: fixed 2, declined 2 on code evidence. Fixes committed as 00a52ea0 - not pushed, per instructions. Reports: standards.md, spec.md, summary.json ({"standards":4,"spec":0}).

Standards

No hard violations. Four judgement calls (skill: .agents/skills/codebase-design/SKILL.md per CODING_STANDARDS.md):

  1. Duplicated Code / lost Locality. The ordered gate (since-start edit first, then author/ever-edit) is open-coded three times and run repeatedly: check_known in src/delivery.rs, the ever-check inside review_input in src/github/review.rs, and the identical closing_issues -> check_known -> review_input -> check_known sequence at both hand-over sites. Five paged edit-history traversals plus three author reads per issue per hand-over. Give the checked-input operation one home and compute since/ever in one traversal.
  2. Shotgun Surgery. Two open-coded error.is::<UntrustedEdit>() twins remain (src/security/review/step.rs, src/processes/source.rs) beside the widened shared predicate. No current behaviour claim (Issue-only paths), but reuse from a pull-request path would swallow the new stop. Route both through the one predicate.
  3. Mysterious Name. is_untrusted_edit returns true for an untrusted author with no edit; closing_issue_use -> ClosingIssueUse -> UnusableClosingIssue uses three stems, none saying "untrusted" or that None means usable, unlike issue_trust -> UntrustedIssue. Rename both.
  4. Stale domain-to-code index (low). docs/code-navigation.md omits closing_issue_use and its ClosingIssues/review_input enforcement points.

Spec

Spec quoted: "Stop a Review run, a Fix run, or a pull-request Custom process, including one started as a Pass, before it uses a linked closing issue unless that issue's author is a Trusted account and no account that is not a Trusted account has edited its title or body." Verdict: no findings - (a) nothing missing/partial across Review/Fix/PR-Custom incl. Pass variants, retained since-unlinked issues, author + title/body + unknown-actor edits, fail-closed reads; (b) no scope creep; (c) nothing implemented-but-wrong.

Fixed

Unaddressed findings

Standards

  • Test #1 Duplicated gate / one traversal - declined. The decision already has one home: closing_issue_trust in src/trust.rs. The three runs are distinct gates, not copies of the decision: pre-read check_known (src/delivery.rs, since-start first, retained links, before issue text is read), the in-builder gate before any issue_for_session (src/github/review.rs, so review_input is safe for any caller), and the post-read check_known (catches an edit or new link during fetch). Merging since/ever into one traversal would conflate the since-start UntrustedEdit (carries run start + run name) with the ever/author check and drop these fail-closed freshness re-reads. The reviewer's evidence greps (run as written, see Validation) confirm the structure; no behaviour is wrong and no failing test was claimed. Not a Spec or Day-shift decision, so no needs-triage issue.
  • Spec: thirdshift, turn a GitHub issue into a ready-for-review PR unattended #2 Widen the two UntrustedEdit twins - declined. Both are Issue-only by construction: src/security/review/step.rs documents "An untrusted issue edit stops the Process", and its caller gates sessions with prepare_for_session(issue_run.issue, ...) in src/processes/source.rs. UnusableClosingIssue is constructed only on pull-request paths (src/delivery.rs, src/github/review.rs), and the pull-request security review already uses the shared predicate (src/processes/review.rs). Widening now is Speculative Generality for a hypothetical reuse. The reviewer made no current-behaviour claim. Not a Spec or Day-shift decision, so no needs-triage issue.

The older GitHub::new() Standards note already documented in the PR body was not raised by this review and was left untouched.

Spec

None.

Review coverage

Fixed point 0d205f00966d1ed024fd2b6660ceaa28c2f39557 (equals main and the merge-base), 3 commits, 15 changed files. Standards and Spec each read every changed file on the first pass (full lists in the report files above), including site/docs/index.html by its hunks. Generated-output exclusions: none on either axis. Changed files left unread: none - no follow-up round was needed.

Validation

PR state checked once, immediately before final validation: gh pr view 2338 --json state,title - OPEN. Extra command list was []. Each command below ran in this worktree; failures did not skip later commands. Logs in .review-logs/ and .affected-tests/ (uncommitted).

  • Reviewer evidence, as written: grep -rn "is::<.*UntrustedEdit\|is_untrusted_edit" src --include="*.rs" (found the predicate, 4 callers, 2 twins); grep -rn "closing_issue_use\|check_known" src/delivery.rs src/github/review.rs src/processes/review.rs (confirmed gate sites); grep -n "closing_issue_use" docs/code-navigation.md (exit 1, no matches - finding Pre-flight checks #4 confirmed). No finding claimed current behaviour is wrong, so no finder test applied.
  • cargo test --bin thirdshift trust::tests before fixes - 23 passed, 0 failed.
  • cargo fmt --check - exit 0.
  • cargo test --bin thirdshift trust::tests after renames - exit 0, 23 passed.
  • scripts/affected-tests main (first run) - exit 1: npm test --prefix site failed, Cannot find package 'marked' (site deps not installed); script stopped before the Rust suite.
  • npm ci --prefix site - exit 0 (setup per site/tests/README.md; no lockfile change).
  • scripts/affected-tests main (second run) - exit 1: npm test --prefix site PASS (74 passed, incl. docs:check); cargo nextest run FAIL exit 100, fail-fasted at 542/4926 (541 passed, 1 failed, 219 skipped).
  • cargo nextest run --no-fail-fast - exit 100: 4926 run, 4925 passed, 1 failed, 219 skipped (3608s). Sole failure: plan_usage::fleet_plan_usage_groups_shared_logins_and_keeps_an_offline_peer_cached (tests/console/plan_usage.rs:706), which asserts on harnesses found on this host (left includes the local muse install). That test is in neither the PR diff nor this review diff, and the PR body records the identical failure on a2ba006e before this review - pre-existing and host-dependent, not a regression. All Review/Fix/trust tests for this change are inside the 4925 passed.

Totals: Standards 4 findings (worst: #1 duplicated gate, declined above), Spec 0 findings (worst: none).

Security

  • Security review on grok failed; see Session trace

CI passed or absent at 00a52ea

@JacobStephens2 JacobStephens2 removed the in-progress A Claim: thirdshift has taken this issue label Nov 26, 2026
The Spec review found every new test stopped at prepare and every
mid-run test used a future-dated edit, so no test reached the
Delivery, push or Self-merge stops with UnusableClosingIssue. Add
the reviewer's back-dated-edit test at push and a Self-merge twin:
dropping UnusableClosingIssue from is_untrusted_closing_issue
makes the twin fail with the pull request drafted, which proves it
reaches that predicate site.

Name the new error mode in review_input's doc comment, and list
tests/review_pass.rs and tests/fix_pass.rs in the Trusted-account
row of docs/code-navigation.md, where the Pass stops live.
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Delivery completed on agent-authored or reviewed head f162fab.

@JacobStephens2 JacobStephens2 added the in-progress A Claim: thirdshift has taken this issue label Nov 26, 2026
@JacobStephens2

Copy link
Copy Markdown
Owner Author

Review run. Pushed fixes to issue-2337 at 4932210. Spec axis used the linked closing issues.

Reviewed PR #2338 against fd7694e2e9c678f905118690a1cc873c62eb1065 using linked issue #2337 as the Spec. Fixed all four actionable findings in local commits 00369574 and 4932210e. The final validation passed 4,938 Rust tests and 74 site tests. The worktree is clean. Spec issue #2337

Standards

  • Ambiguous closing-issue diagnostic. Two linked issues in different repositories could both appear as #7. The error now identifies the issue as owner/repo#number. The retained regression test failed before the fix and passed afterward. Trust diagnostic

Spec

  1. Review could publish findings after its final trust check failed. Delivery now propagates trust and eligibility errors before commenting. A successfully observed head-only move still follows the existing report or merge-hold path. Review Delivery
  2. Fix could push Repair work after rejecting a linked issue. A typed trust stop now bypasses remote failure preservation and drafting. Unpublished work stays local and is recorded in Recovery. The manual and site copy describe that behavior. Delivery, Fix manual
  3. Local cleanup could discard a pending merge with a clean index. Cleanup now checks the same Git operation markers as Review recovery. The regression test verified that the pending merge survives cleanup. Worktree cleanup, Regression test

Unaddressed findings

Standards

  • Repeated trust reads. The pre-read check preserves the since-start diagnostic and covers previously linked issues. The in-builder check guards its own read, and the post-read check checks for changes during that read. The PR body records the decision to preserve that ordering and freshness. Delivery checks, Review input
  • Fresh GitHub adapter. The current callers use the same default interruption and quota policies as the client created inside the check. The PR body records the decision to follow the existing since-start check. GitHub defaults, Fix handover, Review caller

Spec

None. Neither Standards observation required a Day shift decision.

Coverage

Both reviewers read all 18 files in the pinned diff, including the changed generated manual hunks. There were no generated-output exclusions. Standards did not read src/worktree/review_recovery.rs, which was changed during the fixes. Spec read its operation-marker code, and I checked the final hunk. The reports include both reviewers’ full files-read lists. Standards report, Spec report and visual evidence, Finding counts

Validation

I used the pinned base because local main precedes it. The validation PATH excluded the host’s installed Harness binaries from discovery.

Exact command Result
gh pr view 2338 --repo JacobStephens2/thirdshift --json state --jq .state Exit 0, OPEN. Checked once before validation.
setsid --wait env PATH="$HOME/.cargo/bin:/usr/local/bin:/usr/bin:/bin" scripts/affected-tests fd7694e2e9c678f905118690a1cc873c62eb1065 Exit 0 on 4932210e. npm test --prefix site passed 74 tests. cargo nextest run passed 4,938 tests with 219 profile skips.
env PATH="$HOME/.cargo/bin:/usr/local/bin:/usr/bin:/bin" scripts/affected-tests fd7694e2e9c678f905118690a1cc873c62eb1065 Both earlier attempts passed the site suite. The first exited 1 after a missing Rust import caused build exit 101. I fixed the import. The second ended with SIGTERM, exit 143, before the Rust summary.
cargo test --bin thirdshift trust::tests::closing_issue_stop_names_distinct_issues_with_the_same_number -- --exact Exit 101 before the fix, exit 0 afterward.
cargo test --bin thirdshift worktree::cleanup_tests::local_preservation_keeps_dirty_or_unpushed_work_and_cleans_a_clean_checkout -- --exact Exit 0.
cargo test --bin thirdshift worktree::cleanup_tests::local_preservation_keeps_an_unfinished_merge_with_a_clean_index -- --exact Exit 0.
setsid --wait cargo test --test fix_run --test review_run --test review_merge --test fix_pass --test review_pass closing_issue Exit 0, 30 passed.
setsid --wait cargo test --test review_run address_mode_reports_a_moved_head_but_stops_publication_after_branch_or_eligibility_changes Exit 0, 1 passed.
setsid --wait cargo test --test review_merge merge_holds_leave_ready_with_pass_specific_exit Exit 0, 1 passed.
npm ci --prefix site, npm run docs --prefix site, npm run docs:check --prefix site Exit 0 for each.
npm test --prefix site, then setsid --wait npm test --prefix site Standalone run ended with SIGTERM, exit 143. Isolated retry exited 0 with 74 passed.
cargo fmt --check, git diff --check fd7694e2e9c678f905118690a1cc873c62eb1065...HEAD Exit 0 for each.

The two Spec source assertions failed before the fixes and passed afterward. The Git proof for the pending merge failed as expected, and the retained product regression passed. The before-and-after browser checks passed on all four pages with JavaScript enabled and disabled. The full scripts and captures are in the Spec report. The extra command list was empty.

Totals — Standards 1, the ambiguous issue diagnostic. Spec 3, with the Fix failure path’s ability to push Repair work the most consequential.

Security

  • Security review on grok failed; see Session trace

CI passed or absent at 4932210

@JacobStephens2 JacobStephens2 removed the in-progress A Claim: thirdshift has taken this issue label Nov 26, 2026
@JacobStephens2
JacobStephens2 merged commit 1ca2cff into main Nov 27, 2026
26 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-2337 branch November 27, 2026 16:21
@JacobStephens2 JacobStephens2 mentioned this pull request Nov 28, 2026
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.

Require a Trusted account on a linked closing issue

1 participant