Repository navigation
feat(bin): add runtime incident fast path - #3183
campos3097 wants to merge 21 commits into
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (8): Last reviewed commit: "no-mistakes: apply CI fixes" | Re-trigger Greptile |
…ts and local paths
…atus transparency
|
Speaking as Kun's firstmate: Reviewed HEAD Class: default-behavior. The new skill auto-loads at the first runtime-incident report ( VISION (per rule, inspected evidence):
Author's own risk assessment on the PR is High. That matches the inspected map. Attestation: First-time fork CI: after that full-diff review I approved workflow runs This is waiting on the author, not the captain: keep diagnosis and workflow authority agent-adjudicated (the script may validate schema and record transitions, not map classification → code-change/approval routing); do not ship this as a default Bearings/fleet surface (opt-in if it returns); push an attestation whose |
9c14dc1 to
2b8cd4d
Compare
| if diagnosis_input is not None and operational_repair_ready: | ||
| if type(approval_required_input) is not bool: | ||
| raise IncidentError("a no-code diagnosis requires boolean approval.required") | ||
| approval_required = approval_required_input |
There was a problem hiding this comment.
When a no-code diagnosis supplies approval.required: false, triage accepts that value and starts the incident directly in repair, allowing the operational workflow to advance to verification without the captain approval required by the documented no-code path.
Context Used: If there is a VISION.md file at the root of the re... (source)
Intent
Implement a focused runtime incident fast path in FirstMate from the verified current origin/main baseline without modifying TitanOS or any preserved TitanOS worktree. Before creating branches, clones, worktrees, implementation plans, validation, or release work, classify incident requests into application code defect, deployment or routing defect, external dependency quota billing credential or configuration failure, local background-service failure, or unknown. Run bounded read-only triage first: resolve canonical repository and remote; inventory relevant worktrees, clones, branches, registry entries, and workers with exact directory, objective, age, and incident relevance; detect stale registry paths, superseded continuations, detached checkouts, and duplicate repository copies; inspect production identity, logs, health, provider errors, quotas, and managed services when available; and make no code edits during triage. Emit probable root cause and evidence, authoritative repository or worktree, whether code change is required, unrelated or drifted workers, safest next action, and required approval. If no code change is required, create no worktree and run no code tests, CI, PR, or deployment; request only the narrow operational approval, perform the authorized repair, and verify the full runtime path. If code is proven necessary, use one authoritative current-main continuation, preserve unrelated work, keep origin/main policy authoritative, transfer only incident-related changes, and use normal validation and release. Warn on scope drift and never stop, delete, or rewrite another worker or worktree without explicit authorization. Cover stale registry, duplicate clones with one origin, wrong worker worktree, external quota no-code failure, already-deployed hotfix, and proven code-defect escalation. Expose triage to diagnosis to approval to repair to verification in status and demonstrate simulated quota exhaustion. Keep the conductor redesign focused. User authorized all remaining pipeline gates automatically. Preserve all existing pipeline fixes. Resolve the current Greptile P1 by keeping semantic incident judgment agent-owned: scripts may perform deterministic evidence collection and validation but must not override an agents adjudicated classification, code-change decision, approval requirement, or workflow routing with a fixed category map.
What Changed
Risk Assessment
🚨 High: The change can still falsely clear a stale worker checkout and gives agents an impossible lifecycle instruction for the newly supported approval-free path.
Testing
Baseline inspection confirmed target commit
2b8cd4de47035126029ae3e0043e2c3d79ef9073and a clean worktree; the focused runtime-incident suite passed, and a fresh-checkout quota-exhaustion simulation demonstrated read-only triage with no new worktree, narrow approval, operational repair, complete runtime verification, and matching human/Bearings status. The first transcript attempt had a zsh/Bash harness mismatch before product execution, then succeeded under Bash; its temporary fixture was removed and the CLI transcript was retained as reviewer-visible evidence.Evidence: Quota-exhaustion end-to-end CLI transcript
Source: Quota-exhaustion end-to-end CLI transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-runtime-incident.py:905- Intent requires scripts to “not override an agents adjudicated classification, code-change decision, approval requirement, or workflow routing with a fixed category map.” This code derivescode_change_requiredfromDIAGNOSIS_CODE_REQUIREMENTand rejects the agent’s supplied decision; it likewise ignores an agent-suppliedapproval.required:falseand silently emitstruefor every actionable no-code category. Accept independently adjudicated decision/approval fields at this boundary and limit deterministic validation to types, evidence, and authority invariants.bin/fm-runtime-incident.py:769- Candidate capping can silently mark a shown stale worker as correctly placed. With the canonical checkout plus 64 candidate paths, one registered worker path falls outsiderepo_info.copies; althoughcollect_workersprobes that checkout,registered_copyis absent, sostale_pathremains false and the row reportsrepository_match:trueandwrong_worktree:falsebased only on matching origin. Comparecwd_recordagainst the authoritative remote head at this boundary, or report placement as unknown when the candidate was omitted.🔧 Fix: Honor agent routing and reconcile capped workers
2 errors still open:
bin/fm-runtime-incident.py:772- A capped worker checkout is still reported as correctly placed when itsorigin/mainmatches authority but its actual checkout is stale. With 64 earlier candidates, a worker clone detached at an old HEAD is absent fromrepo_info.copies; this branch compares onlyremote_default_head, leaves the earlierwrong_worktree:falseunchanged, and omits the worker from stale/wrong-worktree lists. Reconcilecwd_record.head/detached state here, or report placement as unknown unless it is positively verified..agents/skills/runtime-incident-fast-path/SKILL.md:47- The accepted approval-free route is contradicted by the runtime skill: triage can now emitapproval.required:falseand phaserepair, while these instructions unconditionally tell the agent to request approval and invokeapprove, which necessarily refuses that record. Branch the instructions onapproval.required, usingapproveonly when true and proceeding directly to the adjudicated repair when false.✅ **Test** - passed
✅ No issues found.
git status --short && git rev-parse --show-toplevel && git rev-parse HEADgit diff --stat 7ee0c192e9d664b022361bd4609303bebfc7de14..2b8cd4de47035126029ae3e0043e2c3d79ef9073and changed-file inspectiontests/fm-runtime-incident.test.shFresh-repository CLI lifecycle:fm-runtime-incident.py triage→approve→repair→verify→ humanstatus→fm-bearings-snapshot.sh --jsonFinalgit status --short, evidence readability, and temporary-fixture cleanup checks✅ **Document** - passed
✅ No issues found.
🔧 Fix: Confirm clean lint with pinned toolchain
1 warning still open:
✅ **Push** - passed
✅ No issues found.