Repository navigation
fix(registry): serve explicit heartbeat requeues first and reference the refresh fence tracking issue - #7648
Conversation
…the refresh fence tracking issue Requeue comply only cleared next_compliance_check_at while the heartbeat batch orders by last_checked_at ASC NULLS FIRST, so an agent with a recent authoritative run never moved forward. Record requeued_at on requeue, order by it first, and clear it when an authoritative run is published. The human refresh 503 and refresh_availability now carry tracking_issue (adcontextprotocol#7457) so owners can follow the fence. Closes adcontextprotocol#7632 Claude-Session: https://claude.ai/code/session_01EhqPiLqfuPcPa15YGbUtpz
IPR Policy Agreement Required@idemidenko — thanks for the contribution. Before this PR can be merged, the AgenticAdvertising.Org IPR Policy requires your agreement. To agree, post a new comment on this PR with the exact phrase: Your signature is recorded once and covers all contributions to AAO repositories. See |
|
I have read the IPR Policy |
1 similar comment
|
I have read the IPR Policy |
|
I found that this PR’s migration number ( |
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, well-scoped bugfix with no blocking findings.
What I checked:
- Migration 608 (
server/src/db/migrations/608_agent_registry_requeued_at.sql) adds arequeued_atcolumn, idempotent/additive — judged as production-facing (runs on startup) and safe. requeued_atlifecycle verified: set on requeue, cleared on authoritative publish, preserved across lock/deferral. Fixes #7632 (requeues sort ahead of regular cadence).- New required
tracking_issuefield on the human-refresh fence response is consistent across the constant, zod schema, OpenAPI (static/openapi/registry.yaml), and dashboard — all four availability emitters agree, no wire-shape drift. - Changeset scope: correct app-layer-only change, no protocol-surface (
static/schemas/source/**) modifications, so no changeset required. - New integration + unit test coverage added for the new branches.
High-risk flag: true, but reasons are a new migration file (added) — normal scaffolding, not escalation-worthy — and a (modified) route file with no medium-or-higher finding, so presumed safe.
Gate checks: gated_paths false; no no-auto-approve team match; review_decision REVIEW_REQUIRED does not force any row (row 2 only fires when gated_paths is true). No critical/high/medium findings; only a Low doc nit ("migration 605" vs actual 608) which is omitted per severity model. Falls through to row 9 → approve.
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean pass, no blocking findings.
This PR adds a requeued_at column plus additive migration 608 and reorders the compliance heartbeat so explicit owner requeues are served ahead of the regular cadence (#7632), and surfaces a tracking_issue link on the paused human-refresh response (#7457).
Checks performed:
- Migration 608 is additive and startup-safe (migrations run automatically on startup; judged as production-facing) — no destructive or backfill risk.
- Requeue-clear lifecycle verified: authoritative publish clears
requeued_at, deferral preserves it. - API/OpenAPI/zod consistency: required-field shape consistent across
registry-api.ts,registry.yaml, and zod. - Queue-lane semantics preserved.
- Changeset scope: operational/migration-only PR, none required (server-only, no
static/schemas/source/**or normative-doc surface touched). - Dashboard XSS: escaping verified on the new tracking_issue link surface.
High-risk flag is true only for a new migration file (added) and a modification to registry-api.ts; the reviewer found no medium-or-higher concerns on the modified file, so the modification is presumed contract-preserving. No deletions in sensitive paths. gated_paths is false and review_decision is APPROVED.
Decision table: rows 1–8 do not fire (no critical/high/medium findings, no gated-path/deletion/team triggers, prior decision was approve). Falls through to row 9 → approve.
|
RC6 gating dependency cleared & fleet telemetry context Flagging that v3.2.0-rc.6 shipped this morning ( Declaring an interest first: I reported the symptom this fixes, so I am not a neutral party here. The condition is registry-wide rather than specific to one operator, which is why the numbers seem worth having on the thread. Registry staleness measured across all 34 agents with a compliance record, as of
How #7648 addresses this. Under One observation for maintainers. The 5 agents at the head — 2 never checked, 3 at 71–78 days — look like a separate failure mode from the general 2–14 day backlog, and the empty 14–60 day band is what suggests two mechanisms rather than one. #7648 will let requeued runs jump ahead and unblock active owners; those five may still warrant a look at the job records, in case they are in a state the scheduler skips rather than merely sorting late. Noting it as a separate question rather than scope for this PR. |
|
Thanks for the 605 → 608 renumber and the CI-after-review change. Both are on the branch and I have nothing further to push. The PR is approved and mergeable; could a maintainer merge it when convenient? Once it lands, a requeue will actually reach agents with a recent |
Summary
Fixes the requeue-ordering bug from #7632 and adds the missing tracking reference to the human-refresh fence.
requeueForHeartbeatonly clearednext_compliance_check_at, whilegetAgentsDueForCheckorders bylast_checked_at ASC NULLS FIRST, so an agent with a recent authoritative run sorted behind every agent checked earlier and "Requeue comply" never moved it forward. Newagent_registry_metadata.requeued_atcolumn (migration 605), set byrequeueForHeartbeat, ordered first (requeued_at ASC NULLS LAST), and cleared in theschedule_nextCTE when an authoritative run is published, so a requeue is served once and the agent then falls back to the regular cadence.HUMAN_REFRESH_AVAILABILITYnow carriestracking_issue(fix(auth): preserve queued refresh credential provenance #7457). It is returned in the 503 body and inrefresh_availabilityon/compliance, declared in the OpenAPI schema (static/openapi/registry.yamlregenerated), and linked from the dashboard fence notice. Thealternative_descriptionwording is updated to reflect that requeues are now prioritised.Not included: the
getAuthInfoByOrgAndUrlORDER BYfrom the triage.agent_contextshas hadUNIQUE (organization_id, agent_url)since migration 109 and migration 525 collapsed URL variants, sorows[0]cannot flip between duplicate rows; the credential change reported in #7632 needs a different explanation.App-layer only, no changeset.
Validation
npx tsc --project server/tsconfig.json --noEmitnode tests/migration-validation.test.cjsnode scripts/check-changeset-protocol-scope.cjs origin/mainnpx vitest run --config server/vitest.config.ts tests/unit/dashboard-agent-refresh.test.ts tests/unit/compliance-heartbeat.test.tsDATABASE_URL=… npx vitest run --config server/vitest.config.ts tests/integration/compliance-run-publication.test.ts tests/integration/registry-api-agent-refresh.test.ts(new case:serves explicit requeues ahead of agents with an older authoritative check)npx tsx scripts/generate-openapi.ts && git diff --exit-code static/openapi/registry.yamlCloses #7632
https://claude.ai/code/session_01EhqPiLqfuPcPa15YGbUtpz