Repository navigation
refactor(irq): rename epoch_scoped to resets_on and NMI to IMMEDIATE - #11460
Conversation
|
Intent: Make the monitor kernel's Not a goal: any behaviour change; any change to the persisted on-disk encoding ( |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Third-party probes built from the old app-kit example break on [DESIGN-REVIEWED] f92fb3d |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One thing to verify: the claim that no installed, registered cron script still constructs What this change shipsInventory (6 items) — 6 justifiedIntent: make the interrupt kernel's probe-facing names match what the owning spec already recorded (
[FIRST-PRINCIPLES-REVIEWED] f92fb3d |
|
CI note, not a review item: the three red Two distinct signatures, neither in a file this PR touches (this diff is
Positive control: the same shard set 3/4/6 is red on unrelated PR #11457 right now, and 1/3/6/8 on #11450. Neither remedy is available from this branch. A rerun replays the merge ref pinned when the run was created, and these are deterministic validation and assertion failures rather than timeouts, so it fails identically. A rebase has nothing to rebase onto: All five review lanes are green on this head with no items raised: Design PASS, First Principles PASS, UX, GPT 5.6 and Opus 4.8 all success, and zero unresolved threads. No new issue filed, since both signatures already have one. |
c652e42 to
3f992db
Compare
|
self-added: no
|
|
self-added: no
|
|
/ai-review override gpt 3f992db: Not a defect, no reachable trigger. irq.Probe has one subclass, PrWatchProbe (probes/gh_pr.py:303), internal and rewritten in this commit; no external probe loader exists. No severity is serialized: disk uses _EPOCH_SENTINEL/_STICKY_SENTINEL (irq.py:134-135) and _dedupe_key still maps REVISION to the epoch sentinel. The one orphan file with the old names is in none of the 13 registered cron paths. The alias prescribed is the post-gate bypass withdrawn in #10945. |
Human judgment recorded@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
3f992db to
82e54f5
Compare
The POSIX Backend Tests job splits the full suite into 4 count-balanced shards (no .test_durations file is committed, so pytest-split falls back to an even-by-count split) under a 50-minute job cap. The slowest shard rides the wall: on #11460 shard 1 ran 50.2 min and was cancelled at 99% with every test passing and zero failures, while shards 2/3/4 ran 36.3/47.1/43.2 min -- three of four within 7 min of the cap. A cancelled shard reds Coverage Gate and PR Readiness on every full-suite PR. The ~33-min fixed collection+coverage cost per shard does not divide, so raising the cap alone would only defer the same hit; more shards is the lever. This mirrors the Windows backend job, which already runs 8 shards for the identical count-split reason. A committed .test_durations file was declined in #8506 over its rewrite-every-refresh cost, so this follows the shard-count path instead. Refs #11526
…11528) The POSIX Backend Tests job splits the full suite into 4 count-balanced shards (no .test_durations file is committed, so pytest-split falls back to an even-by-count split) under a 50-minute job cap. The slowest shard rides the wall: on #11460 shard 1 ran 50.2 min and was cancelled at 99% with every test passing and zero failures, while shards 2/3/4 ran 36.3/47.1/43.2 min -- three of four within 7 min of the cap. A cancelled shard reds Coverage Gate and PR Readiness on every full-suite PR. The ~33-min fixed collection+coverage cost per shard does not divide, so raising the cap alone would only defer the same hit; more shards is the lever. This mirrors the Windows backend job, which already runs 8 shards for the identical count-split reason. A committed .test_durations file was declined in #8506 over its rewrite-every-refresh cost, so this follows the shard-count path instead. Refs #11526
82e54f5 to
147a3bc
Compare
The kernel's Observation carried two names that described its implementation
rather than the condition a probe reports. `epoch_scoped: bool` said which
bookkeeping bucket an entry fell in; `resets_on` says what clears it. `NMI`
borrowed an interrupt term for what is really an urgency claim. Both names are
what `docs/system-specs/modules/monitor-architecture.md` layer 3 asked for.
`resets_on` is a two-member enum, `ResetsOn.REVISION` and `ResetsOn.NEVER`, not a
renamed boolean. The field answers what clears an observation, and a boolean can
only answer yes or no: read as a flag, `resets_on=False` would have to mean "does
not reset on -- nothing", which is the opposite of what NEVER means.
The persisted encoding is untouched, and that is the load-bearing part.
`_EPOCH_SENTINEL` ("=") and `_STICKY_SENTINEL` ("~") are the characters every
state document under the data home is keyed with, `_dedupe_key` still maps
REVISION onto the first and NEVER onto the second, and no severity value was ever
serialized. So no armed watch re-reports an anomaly it has already delivered.
`brief` keeps its position ahead of `resets_on`, unlike the signature the spec
first sketched. Both fields have defaults, so nothing is gained by moving
`resets_on` forward, and reordering would silently redirect every existing
three-positional call rather than fail at it.
Prose moved with the code: the module header's interrupt-concept table, the
probe's wake-reason list, four specs and the app-kit reference third parties copy
from. Five test names carried the retired field name and were renamed, and the
four spec citations of those names were updated with them.
Refs: docs/system-specs/modules/monitor-architecture.md (layer 3)
Refs: docs/request-for-change/rfc-consolidated-monitor.md
147a3bc to
f92fb3d
Compare
…irodotdev#11528) The POSIX Backend Tests job splits the full suite into 4 count-balanced shards (no .test_durations file is committed, so pytest-split falls back to an even-by-count split) under a 50-minute job cap. The slowest shard rides the wall: on kirodotdev#11460 shard 1 ran 50.2 min and was cancelled at 99% with every test passing and zero failures, while shards 2/3/4 ran 36.3/47.1/43.2 min -- three of four within 7 min of the cap. A cancelled shard reds Coverage Gate and PR Readiness on every full-suite PR. The ~33-min fixed collection+coverage cost per shard does not divide, so raising the cap alone would only defer the same hit; more shards is the lever. This mirrors the Windows backend job, which already runs 8 shards for the identical count-split reason. A committed .test_durations file was declined in kirodotdev#8506 over its rewrite-every-refresh cost, so this follows the shard-count path instead. Refs kirodotdev#11526
…irodotdev#11460) The kernel's Observation carried two names that described its implementation rather than the condition a probe reports. `epoch_scoped: bool` said which bookkeeping bucket an entry fell in; `resets_on` says what clears it. `NMI` borrowed an interrupt term for what is really an urgency claim. Both names are what `docs/system-specs/modules/monitor-architecture.md` layer 3 asked for. `resets_on` is a two-member enum, `ResetsOn.REVISION` and `ResetsOn.NEVER`, not a renamed boolean. The field answers what clears an observation, and a boolean can only answer yes or no: read as a flag, `resets_on=False` would have to mean "does not reset on -- nothing", which is the opposite of what NEVER means. The persisted encoding is untouched, and that is the load-bearing part. `_EPOCH_SENTINEL` ("=") and `_STICKY_SENTINEL` ("~") are the characters every state document under the data home is keyed with, `_dedupe_key` still maps REVISION onto the first and NEVER onto the second, and no severity value was ever serialized. So no armed watch re-reports an anomaly it has already delivered. `brief` keeps its position ahead of `resets_on`, unlike the signature the spec first sketched. Both fields have defaults, so nothing is gained by moving `resets_on` forward, and reordering would silently redirect every existing three-positional call rather than fail at it. Prose moved with the code: the module header's interrupt-concept table, the probe's wake-reason list, four specs and the app-kit reference third parties copy from. Five test names carried the retired field name and were renamed, and the four spec citations of those names were updated with them. Refs: docs/system-specs/modules/monitor-architecture.md (layer 3) Refs: docs/request-for-change/rfc-consolidated-monitor.md
Problem / Motivation
Two names in the monitor kernel described how it stores things, not what a probe
is reporting.
Observation.epoch_scopedwas a boolean, andSeverity.NMIborrowed a CPU term.
docs/system-specs/modules/monitor-architecture.mdlayer 3asked for
resets_onandIMMEDIATEinstead, and the code had not caught up, sothe spec described a type that did not exist.
Why it matters
Anyone writing a probe reads these names to decide what to pass.
epoch_scopeddoes not say what an epoch is or why it would scope anything, so choosing between
TrueandFalsehas to be learned from the kernel's internals.NMImeansnothing unless you know interrupt hardware.
The spec asking for one thing while the code shipped another also made the doc
unsafe to follow: a reader doing what it said would write
resets_on=and get aTypeError. The app-kit reference that third-party app authors copy from carriedthe old severity in a worked example, so the misdirection reached outside this
repository.
What changed (motivation → approach → change)
The two names now say what the field decides.
epoch_scoped: bool = Trueresets_on: ResetsOn = ResetsOn.REVISIONepoch_scoped=Falseresets_on=ResetsOn.NEVERSeverity.NMISeverity.IMMEDIATE"=ready","~comment:<id>""=ready","~comment:<id>"(unchanged)resets_onis an enum, not a boolean under a nicer name. The field answers whatclears this, and a boolean can only answer yes or no. Read as a flag,
resets_on=Falsewould have to mean "does not reset on -- nothing", which is theopposite of what
NEVERsays.The last row is what makes this a rename rather than a migration. The kernel never
wrote either name to disk. It writes one of two sentinel characters,
_EPOCH_SENTINEL"="and_STICKY_SENTINEL"~", in front of the probe's ownkey, and
_dedupe_keyis the single place that reads the field. Severity is neverserialized at all. Both sentinels keep their values here, so every state document
already on disk still means what it meant, and no armed watch re-reports an
anomaly it has already delivered.
briefstays ahead ofresets_onin the signature, which is not the order thespec sketched. Both fields have defaults, so moving
resets_onforward buysnothing, and it would silently redirect every existing three-positional call
rather than fail at it.
The prose moved in the same commit: the interrupt-concept table in
src/kiro_crew/irq.py, the wake-reason list insrc/kiro_crew/probes/gh_pr.py,four specs, and the app-kit example. Five test names carried the retired field
name and were renamed, and the four spec citations of those names were updated
with them. The spec section that asked for the rename now describes the type that
exists.
Tests
No behavior changed, so no new test. The existing pins were rewritten onto the new
names and re-run:
test_irq.py-- the two sentinel key spaces, the epoch wipe, the pruneasymmetry, the partial fire, and the bypass path, now
test_immediate_bypasses_the_coalescing_window.test_irq_port_baseline.py-- the ported baseline, including that anIMMEDIATEobservation skips the coalescing window but still keeps its dedupe mask.
test_babysit_pr_watch.py-- the conflict path end to end, and that apre-sentinel key still migrates into the epoch space.
14 targeted node ids pass. isort, black, flake8 and mypy are clean on all five
changed Python files.
Manual verification
Loaded the changed module and read the values back, because a rename either lands
everywhere or breaks at import.
SeverityisWAKE, TERMINAL, IMMEDIATE;ResetsOnisREVISION, NEVER;Observation's fields arekey, severity, brief, resets_on. A default observation still keys as=kand aNEVERone as~k, which is how a persistedalertedmap is keyed today.Also checked for the old names outside the repository, since an installed copy and
a repository copy are two different artifacts. The one hit is a stale
pre-refactor snapshot of
pr_watch.pysitting in an installed crons directory,referenced by no registered cron job; the driver on
mainis a 53-line adapterthat names neither old name, so the copy-then-arm recipe cannot carry either name
into a user's tree.
Related Issues
no linked issue: the ask is recorded in
docs/system-specs/modules/monitor-architecture.mdlayer 3 and indocs/request-for-change/rfc-consolidated-monitor.md, which tracks this work byPR rather than by issue (
tracking-issues: []).Related, and in flight on the same file:
#11455 (
feat(monitoring): retire a watch whose verdict stopped moving) also editsdocs/system-specs/modules/monitor-architecture.md. The two do not overlap -- thatPR's hunks are at lines 327, 491 and 526 plus a layer-5 table cell, and this one
owns 235-268 (layer 3's Observation section) plus name-only fixes at 126 and 307.
Whichever merges second takes a trivial rebase. Neither depends on the other:
this PR renames the
irq.Observation/irq.Severitynames and touches nothingunder
src/kiro_crew/monitoring/, which is where that one works.Pattern harvest
Rule candidate: review-prompt
Pattern: a retired name's prose sweep run with a case-sensitive, word-boundary
grep reports clean while three spellings survive it -- a capitalized adjective at
the start of a comment (
Epoch-scoped keys are bounded...), anidentifier-internal fragment (
test_an_nmi_bypasses..., which\bnmi\bcannotmatch because
_is a word character), and a test name that only a spec cites.All three were present here and each was found only after the first sweep read
clean. Sweeping a retired name needs a case-insensitive substring pass, plus a
check that every test name cited in prose still resolves to a
defin the tree.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)