Skip to content

feat(doop): authors and provenance state in the attestation view [squash] - #172

Draft
congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-7084-a066a42fd26d
Draft

congvc-bot-x99[bot] wants to merge 2 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-7084-a066a42fd26d

Conversation

@congvc-bot-x99

Copy link
Copy Markdown

CHE-7084 (S5 of CHE-7064, plan r3 D1.5, stacked on merged S1 #69 and S3 #70; base main).

What changes

readAttestation adds two fields. readServiceAttestation and both routes (/api/design-attestations/:id, /api/service/design-attestations/:id) return them, since both call it.

  • authors: distinct writers from page_authors for the attested page and every page, on any canvas, whose current issueId is the same. Entry: kind, agentId, taskId, userId, provider, model, sources (sorted write/copy/legacy). '' means none, as in the ledger.
  • provenanceComplete: true only for a non-empty set with no unknown or system row and every agent row holding agentId and taskId.
  • persist.listPageAuthorsOf also reads ledger rows still queued with their frame's next save, after draining running saves. Without that, a writer whose frame was not yet saved would be missing and the set would fail open.

Out of scope and untouched: G5 lock/pin, C00 config or deploy, design_card_guard, any real canvas. S4 (copy inheritance) is a sibling: the copied-page test appends a copy row directly, so it does not depend on S4. Additive change only: no existing field moves.

Red (before the change; 12 of 12 fail at runtime, authors is undefined, not a compile error)

$ bunx vitest run tests/attestationAuthors.test.ts
 × a single designer is complete, with the identity from the ledger
 × a designer plus a metadata editor lists both and stays complete
 × a copied page carries the source rows, listed once with both sources
 × a second page of the same issue adds its writers; a page of another issue adds none
 × a page of the same issue on another canvas counts too
 × a system row makes provenance incomplete
 × an unknown row, here a legacy page, makes provenance incomplete
 × an unknown row on a second page of the same issue also fails closed
 × an agent row without a task id or agent id is incomplete
 × an empty set is incomplete
 × an unbound page lists only its own rows
 × the service view carries the same fields
 Test Files  1 failed (1)
      Tests  12 failed (12)

Green (same file, after the change; split into 14 cases, plus one for an unsaved writer)

$ bunx vitest run tests/attestationAuthors.test.ts
 Test Files  1 passed (1)
      Tests  14 passed (14)
$ bunx vitest run tests/attestationAuthors.test.ts tests/designAttestationService.test.ts tests/designAttestation.test.ts tests/pageAuthors.test.ts tests/writePolicy.test.ts tests/pageAuthorsRestart.test.ts tests/pageAuthorsFailure.test.ts
 Test Files  7 passed (7)
      Tests  122 passed (122)
$ bun run typecheck && bun run lint && bun run format:check && bun run doc-lint   # all pass

S5 acceptance: item 1 (fields on view and both routes, set covers page plus same-issue pages) and item 2 (single designer; designer plus metadata editor; copied page; second page of the same issue; system, unknown and empty set each provenanceComplete: false).

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants