Repository navigation
feat(monitoring): let an edition register a pull-request-shaped monitor kind at boot - #24513
Conversation
|
Local review note: the two local reviewers ran on fallback charters ( |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the seam reuses the existing registry, pull-request facts and owner-credential gate. Built-ins can't be shadowed, and the validator and MCP schema read the live vocabulary. Notes
[DESIGN-REVIEWED] 11b7499 Description read[DESCRIPTION-READ] 478306f02bdaffbb0466d02250714c8f708eef9ffa3756615a9b8c01700400f8 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The public seam has zero callers in this repository, but that is the same as the existing edition seam Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let a downstream edition watch reviews on its own review host without spending a model turn on quiet cycles. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 11b7499 Description read[DESCRIPTION-READ] 76fe2306c3bbde218649dfcab4013d2b58b3587955d80741d21a2b658e2af1c3 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
7de7f79 to
61d08b6
Compare
|
self-added: yes
|
|
@chenmingwei23 @kyleseaman could one of you approve the workflow runs for head This push fixes the First Principles BLOCK on the previous head (one One more thing: on the previous head, Thanks, Marcus |
61d08b6 to
bb3e509
Compare
|
Pushed On Thanks, Marcus |
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does no leg reported, and this was not the nothing-to-adjudicate short circuit No |
|
@chenmingwei23 @kyleseaman could one of you re-run three fork AI lanes on
The rest of the round so far: Design and First Principles passed on Thanks, Marcus |
|
Why the three red lanes on
As a stopgap I ran both line-level lanes locally against Thanks, Marcus |
bb3e509 to
11b7499
Compare
|
@tim-finnigan two things on |
iamwhatever
left a comment
There was a problem hiding this comment.
Recommendation: REQUEST_CHANGES (issue required) at 11b7499aa098f37b0e915cfef02270a2ba71adf0.
The seam itself looks sound. Contributed kinds live in a separate table, so a built-in cannot be replaced, and they may not declare the shadow path or any objective other than review_ready (registry). Contributed parsers run only after every built-in, fold foreign-input errors into ValueError, and must return an https URL with a host (targets). The owner-credential gate is unchanged. The validator resolves the vocabulary per call, and validate_field is the only reader of FieldSpec.allowed.
Blocker: one deferred follow-up has no linked issue. The description says serving the kind list at runtime is a follow-up, and plugins.py documents the gap: the dashboard shows a probing contributed-kind monitor as blocked, with save and restart disabled. Design Review asks for that to land before an edition ships this seam. #17848 covers the provider seam, not the dashboard. Please open one issue for the runtime kind list and link it in the description.
AI findings judged non-blocking
- Design Review: warn when a kind is registered after the controller exists. The ordering is documented, and a late registration fails closed as
provider_unsupported(controller). - First Principles:
register_monitor_kindhas no caller in this repository. That matches the existingregister_source_provideredition seam, and #17848 asks for a pluggable interface (plugins).
All checks are green on this head, tim-finnigan approved it, and there are no change requests. Once the issue is linked, this is ready from my side; a new push would need another review.
— crew-pr-reviewer (r134)
|
@iamwhatever opened #25689 for serving the monitor kind list to the dashboard at runtime, and linked it in the description under the out-of-scope list. No code change, head is still |
Problem / Motivation
Goal: A downstream edition can register its own pull-request-shaped review system as a
monitor_watchkind at boot, so watching a review there costs no model turn on quiet cycles, the same as the four built-in hosts.monitor_watchonly knows GitHub, GitLab, Azure DevOps and Bitbucket. #9546 made each kind a registry entry, but the table is a static literal and the provider table, target parsers and validator allowlists are fixed at import. An edition that ships a review host the public core does not know about has no seam to add a kind, so its users fall back to amonitor_startloop withgate=falsethat spends a full model turn every interval even when nothing changed.Why it matters
Babysitting a review until it lands is the most common long-running watch. For every review system outside the built-in four it is currently the most expensive path the product has. A boot-time seam gives those systems the turn-free probing the built-ins already get, without core learning anything about them. This is the "generic/pluggable provider interface" option #17848 asks for.
Not a goal
review_ready, because they run through the existing pull-request facts, decision and fingerprint path.website/src/monitoring/contract.jsonis a checked-in snapshot of the built-ins, so the dashboard shows a contributed-kind monitor as blocked; serving the kind list at runtime is tracked in dashboard: serve the monitor kind list at runtime so contributed monitor kinds are not shown as blocked #25689.What changed (motivation → approach → change)
The registry already treats a kind as data, so the seam follows the existing
register_source_providerpattern rather than a new mechanism. An edition callsregister_monitor_kind(MonitorKindPlugin(kind=..., provider_factory=..., parse_target=...))once at boot, and every boundary that gates a kind reads it from then on:monitoring/plugins.py(new): the registration call, with loud refusals for a malformed, built-in or duplicate name, a missing callable, or an objective the pull-request path does not implement.monitoring/models.py:MonitorProbeProvideris the one probe contract the controller calls,MonitorProbeplususe_owner_credentials. The controller and a contributed kind's provider both type to it; the shadow path keeps the narrowerMonitorProbe.monitoring/registry.py: contributed entries live in a separate table, so a built-in can never be replaced; lookups and the publicly-armable sets include them;is_pull_request_monitor_kind()replaces the frozenset membership test the facts and projection validators used.monitoring/targets.py: inference tries contributed parsers only after every built-in, so a contributed parser cannot claim a built-in host's URL; normalization dispatches to the contributed parser. Anything a contributed parser raises reads as "not this kind's URL", so callers that handle onlyValueErrorstay correct.monitoring/controller.py: the default provider table adds each contributed kind's provider; a factory that raises is logged and fails only its own kind instead of aborting gateway boot. Owner-credential gating is unchanged, so a contributed kind is fail-closed on channel-created monitors like the non-GitHub/GitLab built-ins, and the registry refuses it the shadow path, which has no such gate.validation_parts/field_engine.py:FieldSpec.allowedmay be a zero-argument callable resolved per validation.MONITOR_WATCH_SCHEMAandMONITOR_UPDATE_SCHEMApass the registry functions instead of their import-time result, which would otherwise freeze the vocabulary before any edition boots.docs/system-specs/modules/monitor-architecture.md: the registry row and Adding a new monitored kind describe the seam and the limits a registrant designs for: register unconditionally from the edition's platform-context builder (every process validates or probes), a monitor whose kind is absent on a later boot stops as blocked, and the dashboard, whose kind list is a checked-in snapshot, shows a contributed-kind monitor as blocked with save and restart disabled.Backwards compatibility
Compatible: every built-in kind, objective and URL resolves exactly as before; with nothing registered the registered set is empty and every new branch is unreachable.
FieldSpec.allowedstill accepts a frozenset; the only reader of it isvalidate_field, updated here.Removes one incidental re-export:
kiro_crew.monitoring.pull_requestno longer importsPULL_REQUEST_MONITOR_KINDS, because the facts validator now asks the registry. The constant still lives inmonitoring/registry.pyand is still re-exported bymonitoring/models.py. No kind, field, key, path or public function is removed or tightened.Reader:
test/test_pull_request_readiness.py, the only importer of the name frompull_request, now imports it frommonitoring/registry.py.Tests
test/test_monitor_kind_plugins.py(new): registration reaches every registry query and an unregistered kind is absent from all of them; a built-in name, a duplicate, an unsupported or empty objective set, a shadow claim and malformed names are refused without side effects; a factory that raises leaves the built-in providers in place; a parser that raises a non-ValueErroris a non-match in both inference and normalization; inference reaches a contributed parser but never lets one claim a GitHub URL; normalization uses the contributed parser and still refuses an unregistered kind; a kind registered after import validates throughMONITOR_WATCH_SCHEMAand an unregistered one is refused; the controller's default table probes a contributed kind and passesuse_owner_credentials=Falsefor both a channel-created monitor and a dashboard one with no recorded grant. An autouse fixture snapshots and restores both module-global tables, so a regressed refusal cannot leak to a neighbour.test/test_monitor_kind_registry.py: the schema-parity assertion resolves a callableallowed.-n 4).test/test_flake_pattern_ratchet.pygreen.allowed) turns at least one of these tests red.Manual verification
N/A — unit coverage drives every boundary the seam touches (validator, targets, controller tick against a real
AutoNudgeService); no UI or external service is involved.Related Issues
Part of #17848
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)