Skip to content

feat(security-issue-sync): gate RM hand-off on Vulnogram state REVIEW; add fill-fields comment for remediation developer - #255

Merged
potiuk merged 4 commits into
apache:mainfrom
potiuk:feat-rm-handoff-gate-on-review-state
May 25, 2026
Merged

potiuk merged 4 commits into
apache:mainfrom
potiuk:feat-rm-handoff-gate-on-review-state

Conversation

@potiuk

@potiuk potiuk commented May 24, 2026

Copy link
Copy Markdown
Member

Summary

Changes the pr merged → fix released hand-off so the release manager never receives a hand-off comment while the CVE record is still in DRAFT state.

  • New template: tools/vulnogram/remediation-developer-fill-fields-comment.md — fires at Step 11 (pr merged) and Step 12 (fix released) when CVE body fields are incomplete OR the CVE record state is still DRAFT after sync's JSON push attempt. Tags the remediation developer; issue stays assigned to them until the gate clears.
  • Both release-manager-handoff-comment{,-oauth-pushed}.md rewritten: drop the DRAFT branch from Step 1; assert "you will never see this comment in DRAFT state"; clearer step-by-step UI actions.
  • .claude/skills/security-issue-sync/SKILL.md updated: two-stage gate (body fields populated + CVE state == REVIEW), Step 1d table rows describing both firing points of the fill-fields comment, new Step 5b.6 (post-push state verification).

Why

A live release manager on the Apache Airflow security tracker hit the existing hand-off comment and replied: "I just do not understand the process probably. I am lost. Unsure what the agent now did and what I need to do." Root cause: the existing template branches the RM through "if state is DRAFT, do X; if REVIEW, do Y" — putting the state-detection burden on the RM. Per the security-team maintainer feedback, the RM should never make state decisions: either the record is ready for them (REVIEW state + all six body fields populated) or it stays with the remediation developer.

The fix moves the DRAFT → REVIEW state-advance responsibility from the RM to sync:

  • At the pr created → pr merged transition (Step 11): sync checks the six mandatory body fields (CWE, Affected versions, Severity, Reporter credited as, Short public summary for publish, PR with the fix). If any is empty, post the new fill-fields comment tagging the remediation developer with the concrete missing list.
  • At the pr merged → fix released transition (Step 12): sync pushes the JSON via vulnogram-api-record-update with body.CNA_private.state = "REVIEW", then verifies the record state actually advanced. If still DRAFT (push blocked, schema rejection, body field still empty), re-fire the fill-fields comment. Do not fire the RM hand-off, do not flip the label, do not swap assignees.
  • The RM hand-off comment fires only when sync confirms state == REVIEW. The template asserts this invariant in its body so any misfire is recognizable to the RM.

What's not in this PR

  • vulnogram-api-record-fetch CLI — referenced in the new Step 5b.6 verification, but not yet implemented. Sync will need to either fall back to extracting the saved-state from vulnogram-api-record-update's response envelope (which already includes CNA_private.state), or this CLI lands in a follow-up PR.
  • Generator support for setting state: "REVIEW" in the pushed JSON — generate-cve-json currently defaults to state: DRAFT. Auto-promote requires either a generator flag or sync post-processing the JSON before push. Implementation TBD; the SKILL documents the desired behaviour.
  • Publication-ready template UX rewrite — same treatment as the hand-off templates is planned but not in this PR; will follow as a separate PR once the hand-off changes settle.
  • tools/vulnogram/record.md state-machine section update — needs to reflect that sync now auto-promotes DRAFT → REVIEW; not yet updated here.

Test plan

  • Manual rendering check: re-render both hand-off templates with the substitution placeholders, eyeball for readability.
  • Walk through the new flow on a fresh tracker (e.g. the next cve allocated tracker reaching pr merged):
    • All 6 fields filled at pr-merged → fill-fields comment NOT fired; the existing CVE-tool comment apply still proceeds.
    • Any field missing at pr-merged → fill-fields comment posted, tagging remediation developer.
    • Field filled between sync runs → fill-fields comment PATCH-flipped (not duplicated) with refreshed missing-list.
    • Body fields all filled but JSON push failed → fill-fields comment re-fires with the push-failure description.
  • No breaking change to idempotency: the markers <!-- apache-steward: release-manager-handoff v1 --> (both variants) stay the same; only the body content changed.
  • The new fill-fields template's marker <!-- apache-steward: remediation-developer-fill-fields v1 --> is unique to this template.

🤖 Generated with Claude Code

potiuk added a commit to potiuk/magpie that referenced this pull request May 24, 2026
Addresses the four follow-up TODOs called out in apache#255's PR description:

Task 1 — vulnogram-api-record-fetch CLI
- New file: tools/vulnogram/oauth-api/src/vulnogram_api/record_fetch.py
- Read-only counterpart to vulnogram-api-record-{update,publish}
- Supports --state-only for cheap shell-parsing of CNA_private.state
- Defaults to one-line JSON output on stdout for jq piping
- Wired into pyproject.toml as the `vulnogram-api-record-fetch` script

Task 2 — generator already auto-promotes state on field-readiness
- Discovery: generate-cve-json's compute_cna_private_state already
  emits CNA_private.state = "REVIEW" automatically when all required
  body fields are populated (CVE ID, title, description, affected
  versions, CWE, non-Unknown severity, at least one credit, at least
  one reference). No new --state flag is needed.
- Updated SKILL.md to describe this correctly: sync just pushes the
  generator-emitted JSON; Vulnogram accepts the state field verbatim.

Task 3 — publication-ready comment templates rewritten
- Both manual-paste and oauth-pushed variants now reflect the new
  workflow where sync drives READY → PUBLIC + tracker close.
- Templates are informational only; no RM action required at the
  publication-ready moment. The wrap-up comment (posted post-close)
  is the single RM-action surface for the board archive + milestone
  close.

Task 4 — tools/vulnogram/record.md state-machine update
- State table: DRAFT → REVIEW now set by sync (via generator);
  READY → PUBLIC now sync-driven via vulnogram-api-record-publish.
- Release-manager checklist rewritten: RM-side write count is now
  zero in the common case (sync handles steps 1, 2, 6, 7, 8;
  RM only clicks REVIEW → READY in step 3 + previews + sends in
  steps 4-5).
- Two-record-write-paths section updated to describe the new layered
  state-transition model.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
potiuk added a commit to potiuk/magpie that referenced this pull request May 24, 2026
…lates

lychee CI on apache#255 caught two broken fragment links pointing at
`README.md#for-release-managers--steps-1215` — that anchor does not
exist in the framework README (no "For release managers" section
there). Replace with a relative link to `tools/vulnogram/record.md`
which already carries the full RM-side checklist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
potiuk and others added 4 commits May 25, 2026 00:54
Changes the `pr merged → fix released` hand-off so the release manager
never receives a hand-off comment while the CVE record is still in
`DRAFT` state. State-advance responsibility moves from the RM to sync.

- New template `tools/vulnogram/remediation-developer-fill-fields-comment.md`
  — fires at Step 11 (pr merged) and Step 12 (fix released) when CVE
  body fields are incomplete OR the CVE record state is still DRAFT
  after sync's JSON push attempt. Tags the remediation developer;
  issue stays assigned to them until the gate clears.
- Both release-manager-handoff-comment{,-oauth-pushed}.md rewritten:
  drop the DRAFT branch from Step 1, assert "you will never see this
  comment in DRAFT state", clearer step-by-step UI actions.
- security-issue-sync/SKILL.md updated with the two-stage gate
  (body fields populated + state == REVIEW), Step 1d table rows
  describing both firing points of the fill-fields comment, and a
  new Step 5b.6 (post-push state verification).

Follow-ups (not in this PR): vulnogram-api-record-fetch CLI;
generate-cve-json --state flag; publication-ready template UX
rewrite; tools/vulnogram/record.md state-machine section update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses the four follow-up TODOs called out in apache#255's PR description:

Task 1 — vulnogram-api-record-fetch CLI
- New file: tools/vulnogram/oauth-api/src/vulnogram_api/record_fetch.py
- Read-only counterpart to vulnogram-api-record-{update,publish}
- Supports --state-only for cheap shell-parsing of CNA_private.state
- Defaults to one-line JSON output on stdout for jq piping
- Wired into pyproject.toml as the `vulnogram-api-record-fetch` script

Task 2 — generator already auto-promotes state on field-readiness
- Discovery: generate-cve-json's compute_cna_private_state already
  emits CNA_private.state = "REVIEW" automatically when all required
  body fields are populated (CVE ID, title, description, affected
  versions, CWE, non-Unknown severity, at least one credit, at least
  one reference). No new --state flag is needed.
- Updated SKILL.md to describe this correctly: sync just pushes the
  generator-emitted JSON; Vulnogram accepts the state field verbatim.

Task 3 — publication-ready comment templates rewritten
- Both manual-paste and oauth-pushed variants now reflect the new
  workflow where sync drives READY → PUBLIC + tracker close.
- Templates are informational only; no RM action required at the
  publication-ready moment. The wrap-up comment (posted post-close)
  is the single RM-action surface for the board archive + milestone
  close.

Task 4 — tools/vulnogram/record.md state-machine update
- State table: DRAFT → REVIEW now set by sync (via generator);
  READY → PUBLIC now sync-driven via vulnogram-api-record-publish.
- Release-manager checklist rewritten: RM-side write count is now
  zero in the common case (sync handles steps 1, 2, 6, 7, 8;
  RM only clicks REVIEW → READY in step 3 + previews + sends in
  steps 4-5).
- Two-record-write-paths section updated to describe the new layered
  state-transition model.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lates

lychee CI on apache#255 caught two broken fragment links pointing at
`README.md#for-release-managers--steps-1215` — that anchor does not
exist in the framework README (no "For release managers" section
there). Replace with a relative link to `tools/vulnogram/record.md`
which already carries the full RM-side checklist.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… asks from RM-facing comments

Per RM feedback on a live tracker — *"Same here for step 3 — not idiot
safe (I fail to understand)"* — the original Step 3 of the hand-off
comment (and the matching wrap-up comment) asked the release manager
to manually archive the tracker from the board and close the
milestone. Both actions are already sync-driven (the
`archiveProjectV2Item` GraphQL mutation fires on every close per
Step 4's apply mechanic; the milestone-close PATCH fires when the
just-closed tracker was the last open sibling), so listing them as
RM tasks created the same confusion class the new state-gated
hand-off was designed to eliminate.

Changes:

- `release-manager-handoff-comment{,-oauth-pushed}.md`: Step 3
  rewritten. Now lists the auto-archive + auto-close-milestone as
  sync sub-steps alongside URL capture / JSON regen / state advance
  / label flip / close. Ends with *"You're done. The lifecycle is
  complete from your side at Step 2 (Send Email)."* — no
  implication that another comment will tag the RM with manual
  cleanups.
- `release-manager-wrap-up-comment.md`: rewritten as **purely
  informational** ("✅ Lifecycle complete"). Lists what sync did
  (state advance + label flip + close + board archive + conditional
  milestone close) but solicits no further action. `MILESTONE_BULLET`
  conditional reads as a status note ("Milestone X closed
  automatically..."), not an ask ("Close milestone X").
- `security-issue-sync/SKILL.md` Step 1d / Step 2b: updated to
  describe the auto-archive + auto-close-milestone as sync sub-steps
  inside the *Advisory archived on `<users-list>`* combined apply,
  and the wrap-up comment as informational-only.

The state-gated invariant from the prior commit on this branch
(handoff fires only when CVE state == REVIEW) plus this cleanup
together give the RM a clean three-action flow with zero
post-Send-Email touchpoints.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@potiuk
potiuk force-pushed the feat-rm-handoff-gate-on-review-state branch from 44b476a to d616172 Compare May 24, 2026 22:54
@potiuk
potiuk merged commit 46a1f62 into apache:main May 25, 2026
13 checks passed
potiuk added a commit that referenced this pull request May 25, 2026
… RM close-out (#274)

* docs(security): align process/roles/README with post-2026 sync-driven RM close-out

Recent sync-skill changes (#202, #222, #225, #255) shifted Vulnogram
REVIEW -> PUBLIC, JSON re-push, board move, and tracker close from RM
hand-clicks to sync automation. The reference docs still described the
pre-2026 flow; this brings them back in sync.

- process.md Step 12: document the two-stage hand-off gate (six
  mandatory body fields populated + CVE record state REVIEW) and the
  Remediation-developer fill-fields comment that fires when either
  gate fails. RM hand-off comment now only fires when both gates clear.
- process.md Step 13: rewrite RM checklist as three single-click
  Vulnogram actions (REVIEW -> READY, send advisory, stop). Drop the
  stale "REVIEW (then READY)" phrasing -- REVIEW is set by sync.
- process.md Step 14: rename to "Capture the public advisory URL and
  close out" and list the eleven actions of sync's combined apply
  (URL capture, short-summary extraction, label flips, JSON re-push,
  READY -> PUBLIC via OAuth API, board move, tracker close, board
  archive, conditional milestone close, wrap-up comment).
- process.md Step 15: collapse to "RM verifies the close-out landed"
  -- the RM has no remaining manual work; just receives a
  purely-informational timeline marker.
- process.md Mermaid diagram + label-lifecycle table + label
  reference table updated to match.
- roles.md "Handoff from the remediation developer": mention the
  fill-fields comment they may receive when six mandatory fields
  are incomplete.
- roles.md "Sending the advisory": replace with the three-step
  Vulnogram clickflow matching process.md Step 13.
- roles.md "Capturing the public archive URL and closing out":
  list the sync-driven combined apply.
- roles.md "Publishing the CVE and closing the issue": now
  "Nothing to do".
- roles.md RM "Tools you use most": drop stale Vulnogram-paste
  language.
- README.md: "Eight skills" -> "Nine skills ... plus one read-only
  supporting skill". Split skills table into "Lifecycle skills" (9)
  and "Supporting tools" (1), adding security-tracker-stats-dashboard.

Generated-by: Claude Code (Opus 4.7)

* docs(security): fix Step 14 link — oauth-api/README.md, not vulnogram-api/SKILL.md

`vulnogram-api-record-publish` is documented in
`tools/vulnogram/oauth-api/README.md`; the previous commit linked a
non-existent `tools/vulnogram/vulnogram-api/SKILL.md`. Caught by
lychee.

Generated-by: Claude Code (Opus 4.7)
@potiuk potiuk added the contract:cve-authority Tool capability: CVE allocation / record management / publication label Sep 25, 2026
@potiuk potiuk added capability:intake Import external signal + sync tracker state family:security security-* skills family:tools tools/* labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:intake Import external signal + sync tracker state contract:cve-authority Tool capability: CVE allocation / record management / publication family:security security-* skills family:tools tools/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant