Repository navigation
Project a case to CSAF at the publication draft step and an operator endpoint - #6809
sei-ahouseholder wants to merge 7 commits into
Conversation
…rator endpoint (#6706) A format-neutral CaseProjectionPort in core, with CSAF as its first adapter. The DETERMINISTIC DraftAdvisoryArtifact backend cuts the case with the public profile and renders it final through the port BTBridge places on the run; the new GET /actors/{actor_id}/cases/{case_key}/csaf endpoint returns the joined projection, interim, and writes nothing. Both take the CSAF category from csaf_category(preview). Lands CSAF-06-012 and CSAF-06-013 with their tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… state the endpoint has no auth (#6706) Pre-push review findings: the endpoint answers every projection failure 409, as the draft step answers it error; the draft's error and wiring branches are tested; the joined-only test covers every value, with a strict xfail holding the open reporter-credit question; stale docstring and auth note fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es moot (#6706) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pre-push review (fresh agent)8 findings, each resolved before the first push:
|
…AF-06-009 (#6706) The maintainer chose to limit the REPORTER default credit to the operator CSAF endpoint: the public profile omits the participants, so the public draft names none (CSAF-06-002 unchanged). project_case takes a required credit_reporters argument, so each call site chooses. The strict xfail is now a passing test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ites # Conflicts: # test/support/case_projection.py
sei-ahouseholder
left a comment
There was a problem hiding this comment.
PR Triage: #6809 — Project a case to CSAF at the publication draft step and an operator endpoint
Linked issues: #6706
Changed files: 31 files — core/services, core/behaviors (call_out, bridge), adapters (fastapi, driven), wire/csaf, specs, notes, docs
CI status: ⏳ pending
Merge state: 📝 DRAFT (BLOCKED: CI gate pending)
Base branch: main
Needs integration tests: yes (CI demo jobs)
Context: loaded afresh — build context head not an ancestor after main merges
Mode: delta (11 files since the pre-push review); all 8 pre-push findings carry forward as fixed on the head, including the held reporter-credit finding, now settled by the maintainer's option A (CSAF-06-009 amended; test_the_public_draft_names_no_reporter_participant passes, not xfail)
Findings
| # | Phase | Severity | Description | Outcome |
|---|---|---|---|---|
| phase9-crosswalk-status-row-stale-0 | docs-currency | overview.md relation table still says producing a CSAF document is "Planned." |
fix-now | |
| phase9-note-runner-port-rule-0 | notes-currency | notes/csaf-projection.md does not tell the future runner of the publication tree to pass case_projection_port |
fix-now | |
| phase3-body-names-missing-file-0 | pr-body | Body names test/support/csaf_schema.py, which does not exist after the main merge |
fix-now | |
| phase3-selfcheck-stale-branch-0 | pr-body | Self-check lists "register embargo by id", a read 06c66b9 removed | fix-now | |
| phase8-redundant-blackboard-clears-0 | code-review | Manual blackboard clears duplicate the root autouse fixture (TB-06-005) | fix-now | |
| phase12-blocked-ci-pending-0 | merge-state | BLOCKED only by draft state and a pending CI gate | fix-now (re-check) |
Total: 0 FAIL · 6 IMPROVE · 0 NEW-ISSUE
AC-6 judgement: no docs/ page lists actor HTTP read routes (only trigger-api.md, for POST triggers), so listing the endpoint in the crosswalk overview and OpenAPI is acceptable; a new API reference page is outside this issue.
Triage artifact: .claude/pr-6809-triage.json
Next step: pr-execute.
Summary
Wires the two CSAF call sites of ADR-0219 onto the profiles and renderer from #6705, through a format-neutral
CaseProjectionPortwhose first adapter is CSAF: the publication pipeline's draft step drafts the case's public projection (final), and a new operator endpoint returns its joined projection (interim) and writes nothing.Issues: closed 1, opened 0
Questions: asked 1, filed 0
Motivation
ADR-0219 names two call sites. Core cannot import the CSAF renderer (ARCH-01-001), so the draft step reaches it through a driven port, in the pattern of
WireRenderPort. The port names no format, so a CVE record (#6759) and a CERT Vulnerability Note (#6760) become later adapters of the same port (notes/csaf-projection.md).Reporter credit (decided by the maintainer, option A): the
REPORTERdefault credit applies only at the operator endpoint, whose joined profile shows the participants. The public draft credits no one unless its caller supplies credit, so it holds no value the public profile omits (CSAF-06-002, unchanged). CSAF-06-009 is amended to say so.Changes
vultron/core/ports/case_projection.py(new):CaseProjectionPort.render(cut, inputs) -> dict; names no format.vultron/core/services/case_projection.py(new):project_case/case_projection, the core half of both call sites. Reads the case whole (participants, reports, items, references, and statuses named by id), dates the document by the commit time of the ledger entry at the case's position, builds the publisher from the actor's record and its case roles, and, when the call site asks for it (credit_reporters=True, a required keyword), passesreporter_acknowledgments(case)as the default credit. The endpoint asks; the public draft does not.require_projection_portraisesVultronWiringErrorfor a missing port.PROJECTION_FAILURESis the one failure rule both call sites apply.vultron/core/services/held_references.py(new):read_held, extracted fromparticipant_suggestion.py, which now uses it (CS-22-001).vultron/errors.py:VultronProjectionError, for a replica that holds the case but not an object it names or the entry at its position.vultron/adapters/driven/case_projection/csaf.py(new):CsafProjectionAdapter, which renders throughrender_csafwith the categorycsaf_category(cut.preview)gives.vultron/wire/csaf/projection.py:csaf_category(preview), the one category selection both call sites reach;csaf_basewhile no case holds products. A CSAF projection renders the vendors' products and statuses, and is a Vulnerability Report or Security Advisory when the preview meets that profile #6785 extends it.vultron/core/behaviors/call_out/bundles/publication.py:DraftAdvisoryArtifactByProjection, the new DETERMINISTIC draft default. It cuts the case withPUBLIC_PROFILE, renders itfinalthrough the port, and answers yes with the document's JSON text. A missing port, store or actor raisesVultronWiringError; a replica it cannot project is error..../capabilities/report_management/publication/advisory.py:DraftAdvisoryArtifactCapabilitydeclares acase_id: strinput port.vultron/core/behaviors/bridge/{bt_bridge,tree_setup}.py,act_keys.py:BTBridge(case_projection_port=...)places the port on the run as aRunKey, and the run's end restores the key (BT-17-007).vultron/adapters/driving/fastapi/routers/actors/_case_csaf.py(new):GET /actors/{actor_id}/cases/{case_key}/csaf. Returns the joined,interimprojection from the actor's replica; 404 for a case it does not hold, 409 for any other projection failure. It checks no requester: request authentication is not built yet (No authentication or message-signing evident in HTTP inbox/outbox delivery paths #509), as its docstring and route description say.specs/csaf-report-content.yaml: amends CSAF-06-009 (see Spec amended); lands CSAF-06-012 (profile per call site) and CSAF-06-013 (the endpoint writes nothing) fromnotes/csaf-projection.md, with verification; CSAF-06-004's verification names the shared-selection tests.notes/csaf-projection.md: the call sites are built; a runner of the publication tree passes the projection port; the note keeps the rules for later adapters and the open rendering rules, and drops the landed requirement text.docs/reference/csaf_crosswalk/overview.md: describes both call sites as built, with profile and tracking status, and says the category comes from one selection over the preview.test/core/services/test_case_projection.py,test/core/behaviors/report/test_publication_draft_projection.py,test/adapters/driving/fastapi/routers/test_case_csaf_route.py,test/adapters/driven/test_case_projection_adapter.py, acsaf_categorytest, a bridge restore test;schema_errorsbeside the existing pinned-schema validator, andstore_projected_replica,publication_draft_runandCALL_OUT_RUN_CONTEXTSintest/support/case_projection.py. The generic DETERMINISTIC-bundle tests tick the draft default inside that run context.Specs
Spec manifest
Loaded (floor): BT-20-004 CSAF-06 ARCH-01-001 ARCH-20-001 OX-10-004 CLP-10-020
Loaded (cross-cutting): ARCH CS EH HP SL TB
Loaded (selected): BT-23 — the DETERMINISTIC draft default must write its declared output (BT-23-013); BT-18 — capability declaration ports and docstring contract (BT-18-001, BT-18-021); BT-25 — run keys vs act keys for the projection port and case_id; CSAF-05 — pinned schema and generated models the projection must pass; BT-17 — the bridge restores the new case_projection_port key on every outcome (BT-17-007, BT-17-012); BTND-03 — the new run key is named in the key vocabulary (BTND-03-022); DL-07 — the projection port holds no store, so it needs no rebinding (DL-07-009); BT-24 — participant suggestion now reads references through the shared read_held, behavior unchanged
Considered, skipped: CM-17 — the invitation preview profile is not touched; MV-12 — no inbound CSAF parsing changes; SYNC-16 — the ledger position is only read, never moved; AF-04 — no activity is built; BT-05 — store reconciliation is unchanged; BT-11 — no tree-shape change beyond one backend; BT-13 — no change to bridge execution semantics; BT-15 — no trigger execute() is touched; CLP-10 — no received tree or commit is touched; DEMOCI-01 — only a new error class is added to vultron/errors.py; EDF-03 — no demo flow change; SBT-01 — no simulator bridge change; SBT-05 — no simulator bridge change; SE-06 — no extraction change
Spec amended
CSAF-06-009
REPORTERrole when the caller supplies none, and MUST NOT derive them from other case data.REPORTERrole when the caller supplies none, and MUST NOT derive them from other case data.REPORTERdefault put participant names, which the public profile omits, into aCLEARdocument, against CSAF-06-002. This changes what the requirement obliges; the maintainer approved it (option A on this PR).Docs
Docs: updated docs/reference/csaf_crosswalk/overview.md (both call sites, profile and status, one category selection, the relation table's status); no actor API reference page exists to list the endpoint in (recorded on #6706)
Verification
test/demo/test_rv_demo.py: one xdist worker crash and four 120 s timeouts, no assertion (contention, Local full test runs hang forever after a pytest-xdist worker dies #4809). That file re-run alone passes.DraftAdvisoryArtifact,draft_advisory_artifact,AlwaysSucceedbeside the draft,case_projection, "no call site",#6706indocs/,notes/,specs/, AGENTS.md files and docstrings. Updated the publication bundle docstrings (core and fuzzer), the capability contract,notes/csaf-projection.mdand the crosswalk overview. No hook or workflow trigger list changes: no check was added or widened.case_held_wholecopies the case and never saves it (test_the_case_is_read_whole_and_the_store_is_not_changed,test_the_endpoint_writes_nothing).read_heldextracted fromparticipant_suggestion.pyand used by both; the pinned-schema validatorcsaf_schema_validatorintest/support/case_projection.py;sorted_case_ledger_entries,find_case,reporter_acknowledgmentsandProjectionCut.ofreused.CaseProjectionPorttakes the cut (which carries theCasePreview) and the call site'sProjectionInputs;CsafProjectionAdapterwires it torender_csaf; a missing port raisesVultronWiringError(test_a_missing_port_is_a_wiring_error_before_any_read,test_a_missing_projection_port_is_a_wiring_error).test_the_publication_tree_drafts_a_schema_valid_public_projectionruns the publication tree on a stored replica and checks the draft key holds a schema-validcsaf_base,final, public document.test_the_endpoint_returns_the_joined_interim_projection,test_a_case_the_actor_does_not_hold_is_404.csaf_category;test_the_draft_takes_its_category_from_the_shared_selectionandtest_the_endpoint_takes_its_category_from_the_shared_selectioncheck each call site asks it.test_the_endpoint_writes_nothing, withtest_the_write_check_is_not_vacuous.verification:naming these tests.docs/has no actor API reference page (recorded on The publication draft step and an operator endpoint each produce a CSAF projection of the case #6706), so the endpoint is listed in the overview's table and in the app's OpenAPI (/docs).🤖 Generated with Claude Code