Skip to content

685: Turn every incident into a check and add alert triage to codebase-architecture - #61

Merged
mblode merged 5 commits into
mainfrom
685-codebase-architecture-turns-every-incide
Oct 8, 2026
Merged

mblode merged 5 commits into
mainfrom
685-codebase-architecture-turns-every-incide

Conversation

@mblode

@mblode mblode commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Summary

Task 685. codebase-architecture now says every incident or repeated mistake ends in a deterministic check. It also tells an unattended job how to triage an alert. Source: the 2026-10-08 call with Ben Friebe (R6, P6, R2, M-a, P9, M3, M4; plan ticket S40).

  • references/enforcement-ladder.md
    • A production failure, a revert, or the same slip twice ends in a type, lint rule, test or CI step, landed with the fix.
    • The rubric's escalation list gains lint config and allowlist files, plus new environment variables.
    • Rung 3 says any change to the lint config or allowlist needs a human. No baseline file.
    • A new judgement gate starts in shadow and is enforced once its labels match human decisions. Lint rules skip shadow and use the ladder.
  • references/agent-runtime.md: a new Alert triage section after "Unattended fix jobs", with three verdicts.
    • Real failure: an issue for the fix job, carrying the alert's fingerprint.
    • Alert is wrong: a draft PR that changes only that one alert's definition, with recent datapoints. It shows the new definition still fires on the last real failure, or on a replayed known-bad sample when the alert has never caught one, so deleting or muting the alert never counts. This is the one exception to the fix job's test rule and to infrastructure being protected, and a person still merges.
    • Every issue or draft the job opens carries the alert's fingerprint, so an open or recently closed one blocks a repeat.
    • Noise: resolve it. A second Noise on the same fingerprint becomes Alert is wrong.
    • Every alert goes to one quiet channel.
  • SKILL.md: line 118 names incidents and repeated mistakes. The description, the reference table row and Harden step 6 name alert triage.
  • evals/evals.json: eval 3's first assertion now holds for a code fix and names the alert-definition exception. New eval 4 and a should-trigger case cover alert triage on its own.

Decisions for the reviewer

  • Shadow-then-enforce covers judgement gates only, so it does not contradict "Ship it green" or rung 3's error over warn.
  • Triage verdicts come from a fixed first line, and an unparsable run counts as Real failure. A bad parse sends the alert to the fix job, whose reproduce step decides. It never silences the alert.
  • Deleting, disabling or muting an alert is never Alert is wrong. The draft has to show the new definition would still have fired on the last real failure. This keeps the exception to one alert's definition.
  • evaluation-scenarios.md is unchanged. None of its scenarios asserts a claim this PR touches. Alert triage gets its own eval in evals.json instead.

Stages: feature; skipped codebase-architecture (no module boundary), product-design/ui-* (no UI), blast-radius (about 40 lines of Markdown), swarm (one fresh-context reviewer instead).

Unchanged on purpose: "Never hand-roll a baseline", eval scenario 4, and the whole "Unattended fix jobs" section, including the verdicts at agent-runtime.md:24. Not added, per the plan: a baseline or ratchet file, a debt-shrinks script, or a 400-line PR budget.

Verification

  • skills/agent-skills-creator/scripts/validate.sh skills/codebase-architecture: 0 FAIL, 31 PASS, 2 SKIP, exit 0.
  • skills/agent-skills-creator/scripts/validate.sh --all: 0 FAIL on every skill, exit 0.
  • python3 -m unittest discover -s maintenance/tests: OK.
  • npx -y taste-lint@0.4.0 lint --dry-run --since origin/HEAD --profile instructions: PASS, no act-band findings.
  • Failure-case diff checks against origin/main:
    • The scenarios diff is empty.
    • The baseline section and the "Unattended fix jobs" section are byte-identical to origin/main.
    • agent-runtime.md changes only line 3 plus an appended section.
    • There are no em dashes.
  • Codex review on 2ef9a19 raised four P2 findings, all fixed in f75aaa4: alert triage added to the description, fingerprint dedupe for drafts, a replayed-sample fallback, and eval 4. All four threads have replies and are resolved.
  • A simplify pass in 4c3d71b removed restated text without dropping a rule: fingerprint dedupe is stated once, the Alert is wrong rule is shorter, rung 3 points at the escalation list, and eval 3 no longer repeats its merge assertion.
  • Codex on 4c3d71b: the simplify pass had dropped the single concurrency group from alert triage's inherited dedupe rule. Restored in 863d4d2, and the thread is resolved.
  • A fresh-context reviewer found nothing blocking. Its should-fix items are applied: the muting loophole, triage running under the fix job's isolation rules, the fingerprint in the issue, and rung 3 matching the escalation list.
  • Not run: with-skill and without-skill behavioural comparisons. Nothing reaches Factory workers until ./mac-mini/setup.sh skills is re-run (#705).

Open point: eval 3's prompt is about error issues, not alerts, yet its first assertion names the alert exception because the brief asks for that. Eval 4 now tests alert triage directly.

Learned: the riskiest part of an alert-definition exception is that "fix the threshold" quietly becomes "turn the alert off". The exception only stays narrow if the draft proves the alert would still have fired on the last real failure.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QS4mU5DxP81inR3AhxCcKy

mblode and others added 2 commits October 8, 2026 21:23
Incidents and repeated mistakes now end in a deterministic check, lint
config, allowlists and new env vars escalate to a human, judgement gates
start in shadow, and agent-runtime gains an Alert triage section whose
Alert is wrong draft is the one exception to the fix-job test and
protected-path rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS4mU5DxP81inR3AhxCcKy
Deleting or muting an alert is never Alert is wrong, triage runs under
the fix job's isolation rules, the issue carries the fingerprint, and
rung 3 now matches the escalation list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS4mU5DxP81inR3AhxCcKy
@mblode
mblode marked this pull request as ready for review October 8, 2026 10:27
@mblode

mblode commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner Author
Verdict: pass. 1 feature covered, 1 skipped (behavioural with/without-skill runs, which need separate isolated sessions), 0 failed. Every Done-when item holds at 863d4d2. The simplify pass in 4c3d71b had dropped the fix job's single concurrency group from alert triage's inherited rules. Codex caught it, and it is back, so overlapping triage runs cannot open two drafts for one fingerprint. The earlier Codex fixes and the simplify pass are otherwise unchanged. Scenario 4, the baseline section and the fix-job verdicts are byte-identical to main. `validate.sh --all` exits 0 and CI validate passes.

@mblode

mblode commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner Author

@codex review

Review current commit 2ef9a192f79098dd244a285e5313ff2b644da4c7.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T19:01:50.065408Z 863d4d2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ef9a192f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/codebase-architecture/SKILL.md
Comment thread skills/codebase-architecture/references/agent-runtime.md Outdated
Comment thread skills/codebase-architecture/references/agent-runtime.md Outdated
Comment thread skills/codebase-architecture/evals/evals.json Outdated
The description now names alert triage, with a should-trigger case and
a dedicated eval 4. An Alert is wrong draft carries its fingerprint,
mutes repeat drafts, and falls back to a replayed known-bad sample when
the alert has never caught a real failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS4mU5DxP81inR3AhxCcKy
@mblode

mblode commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Review current commit f75aaa41fbc74c2ce4a5636e4ed1acc3240d5605.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: f75aaa41fb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mblode

mblode commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Review current commit 4c3d71b6ac8e5c103d3bb508e33b36e32a745de3.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c3d71b6ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread skills/codebase-architecture/references/agent-runtime.md Outdated
@mblode

mblode commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Review current commit 863d4d27e6c8514b5fbfd5d66f72b26a3e3d121b.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 863d4d27e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


## Alert triage

A job where an agent reads a fired monitoring alert, with no person watching, and decides what it is before anything is fixed. An alert is not yet a failure, so triage has its own verdicts, parsed from a fixed first line like the fix job's; anything else counts as a real failure, so a bad parse can never silence an alert. The job runs under the fix job's other rules (read-only split from write, isolated settings, untrusted evidence, caps and dedupe in a single concurrency group), and every issue or draft it opens carries the alert's fingerprint, so an open or recently closed one mutes the next.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Queue every alert before serializing triage

When this is implemented with GitHub Actions and three different alerts arrive while one triage run is active, putting every run in one concurrency group silently cancels the first pending run when the next one arrives, so an alert can receive no triage at all. GitHub documents that the default group retains only one pending run and replaces it with newer runs (GitHub Actions concurrency); require a non-dropping queue such as queue: max, or use fingerprint-scoped groups plus an atomic check-and-create barrier, rather than prescribing a single group without queuing.

Useful? React with 👍 / 👎.

@mblode
mblode merged commit 2de5f22 into main Oct 8, 2026
3 checks passed
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.

1 participant