Skip to content

Project a case to CSAF at the publication draft step and an operator endpoint - #6809

Draft
sei-ahouseholder wants to merge 7 commits into
mainfrom
task/6706-csaf-call-sites
Draft

sei-ahouseholder wants to merge 7 commits into
mainfrom
task/6706-csaf-call-sites

Conversation

@sei-ahouseholder

@sei-ahouseholder sei-ahouseholder commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Wires the two CSAF call sites of ADR-0219 onto the profiles and renderer from #6705, through a format-neutral CaseProjectionPort whose 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 REPORTER default 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), passes reporter_acknowledgments(case) as the default credit. The endpoint asks; the public draft does not. require_projection_port raises VultronWiringError for a missing port. PROJECTION_FAILURES is the one failure rule both call sites apply.
  • vultron/core/services/held_references.py (new): read_held, extracted from participant_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 through render_csaf with the category csaf_category(cut.preview) gives.
  • vultron/wire/csaf/projection.py: csaf_category(preview), the one category selection both call sites reach; csaf_base while 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 with PUBLIC_PROFILE, renders it final through the port, and answers yes with the document's JSON text. A missing port, store or actor raises VultronWiringError; a replica it cannot project is error.
  • .../capabilities/report_management/publication/advisory.py: DraftAdvisoryArtifactCapability declares a case_id: str input port.
  • vultron/core/behaviors/bridge/{bt_bridge,tree_setup}.py, act_keys.py: BTBridge(case_projection_port=...) places the port on the run as a RunKey, 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, interim projection 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) from notes/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.
  • Tests: 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, a csaf_category test, a bridge restore test; schema_errors beside the existing pinned-schema validator, and store_projected_replica, publication_draft_run and CALL_OUT_RUN_CONTEXTS in test/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

  • Before: A CSAF projection MUST take its acknowledgments from its caller, or from the participants that hold the REPORTER role when the caller supplies none, and MUST NOT derive them from other case data.
  • After: A CSAF projection MUST take its acknowledgments from its caller, or, at the operator CSAF endpoint only, from the participants that hold the REPORTER role when the caller supplies none, and MUST NOT derive them from other case data.
  • Reason: at the public draft the REPORTER default put participant names, which the public profile omits, into a CLEAR document, 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

  • Targeted gate (after merging main with feat: the report receiver turns its CSAF report into the caseInputs of its proposal (#6723) #6807 and A joined CSAF projection derives outstanding, deferred and discontinued actions #6808): 20520 pass, 91 xfail. The 5 failures were all in 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.
  • ruff and mypy clean (the type-check second pass is CI's, PAD-18-027)
  • Self-check:
    • Affected text: searched DraftAdvisoryArtifact, draft_advisory_artifact, AlwaysSucceed beside the draft, case_projection, "no call site", #6706 in docs/, notes/, specs/, AGENTS.md files and docstrings. Updated the publication bundle docstrings (core and fuzzer), the capability contract, notes/csaf-projection.md and the crosswalk overview. No hook or workflow trigger list changes: no check was added or widened.
    • Failure paths: no writes changed. The endpoint and the draft backend only read; case_held_whole copies the case and never saves it (test_the_case_is_read_whole_and_the_store_is_not_changed, test_the_endpoint_writes_nothing).
    • Branch coverage: every new branch tested: missing or wrong port, missing store or actor, case not held, an object not held, position index or hash not held, actor with no record, the draft's error paths, the endpoint's 404 and both 409 paths.
    • Reuse: read_held extracted from participant_suggestion.py and used by both; the pinned-schema validator csaf_schema_validator in test/support/case_projection.py; sorted_case_ledger_entries, find_case, reporter_acknowledgments and ProjectionCut.of reused.
  • AC-1: CaseProjectionPort takes the cut (which carries the CasePreview) and the call site's ProjectionInputs; CsafProjectionAdapter wires it to render_csaf; a missing port raises VultronWiringError (test_a_missing_port_is_a_wiring_error_before_any_read, test_a_missing_projection_port_is_a_wiring_error).
  • AC-2: test_the_publication_tree_drafts_a_schema_valid_public_projection runs the publication tree on a stored replica and checks the draft key holds a schema-valid csaf_base, final, public document.
  • AC-3: test_the_endpoint_returns_the_joined_interim_projection, test_a_case_the_actor_does_not_hold_is_404.
  • AC-3a: csaf_category; test_the_draft_takes_its_category_from_the_shared_selection and test_the_endpoint_takes_its_category_from_the_shared_selection check each call site asks it.
  • AC-4: test_the_endpoint_writes_nothing, with test_the_write_check_is_not_vacuous.
  • AC-5: CSAF-06-012 and CSAF-06-013 carry verification: naming these tests.
  • AC-6: the overview section describes both call sites as built and the category's one selection. Its other premise does not hold: 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

ahouseholder and others added 3 commits November 20, 2026 23:34
…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>
@github-actions github-actions Bot added the size:L 1001-2500 diff lines or 4-8 ACs label Nov 20, 2026
@sei-ahouseholder

Copy link
Copy Markdown
Contributor Author

Pre-push review (fresh agent)

8 findings, each resolved before the first push:

  • phase8-public-draft-leaks-reporters-0 (FAIL, inversion-halt): held — Needs the orchestrator's decision (CSAF-06-009 vs CSAF-06-002 at the public call site); PR stays draft. Held by strict xfail test_the_public_draft_names_no_reporter_participant.
  • phase8-joined-only-test-skips-reporter-0 (FAIL, fix-now): fixed — test_the_public_draft_holds_none_of_the_joined_only_content parametrized over content, report and JOINED_ONLY_UNRENDERED; reporter_name held by a strict xfail; CSAF-06-012 verification reworded to what it checks.
  • phase8-stale-draft-factory-docstring-0 (IMPROVE, fix-now): fixed — create_publish_artifact_tree docstring names DraftAdvisoryArtifactByProjection and the run keys it reads.
  • phase8-untested-store-actor-wiring-branch-0 (IMPROVE, fix-now): fixed — test_a_run_without_its_store_or_actor_is_a_wiring_error (both keys).
  • phase8-draft-error-path-underasserted-0 (IMPROVE, fix-now): fixed — Not-held test asserts internal_error and the error text; new test_a_replica_it_cannot_project_fails_the_draft_as_an_error covers VultronProjectionError.
  • phase8-endpoint-uncaught-render-errors-0 (IMPROVE, fix-now): fixed — PROJECTION_FAILURES in core/services/case_projection.py shared by both call sites; endpoint answers 409 and logs; test_a_preview_that_renders_no_document_is_409.
  • phase8-endpoint-auth-not-stated-0 (IMPROVE, fix-now): fixed — _case_csaf.py docstring and route description state no request authentication (No authentication or message-signing evident in HTTP inbox/outbox delivery paths #509).
  • phase2-ac6-premise-unmet-0 (IMPROVE, fix-now): fixed — Recorded on The publication draft step and an operator endpoint each produce a CSAF projection of the case #6706 and in the PR body's AC-6 line: no actor API reference page exists; endpoint listed in overview.md and OpenAPI.

ahouseholder and others added 4 commits November 30, 2026 19:39
…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 sei-ahouseholder left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ⚠️ IMPROVE overview.md relation table still says producing a CSAF document is "Planned." fix-now
phase9-note-runner-port-rule-0 notes-currency ⚠️ IMPROVE 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 ⚠️ IMPROVE Body names test/support/csaf_schema.py, which does not exist after the main merge fix-now
phase3-selfcheck-stale-branch-0 pr-body ⚠️ IMPROVE Self-check lists "register embargo by id", a read 06c66b9 removed fix-now
phase8-redundant-blackboard-clears-0 code-review ⚠️ IMPROVE Manual blackboard clears duplicate the root autouse fixture (TB-06-005) fix-now
phase12-blocked-ci-pending-0 merge-state ⚠️ IMPROVE 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 1001-2500 diff lines or 4-8 ACs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The publication draft step and an operator endpoint each produce a CSAF projection of the case

2 participants