Skip to content

feat(doop): service read route for design attestations (CHE-7080) [squash] - #69

Merged
congvc-dev merged 3 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-7080-ad466bf8e9b2
Nov 23, 2026
Merged

congvc-dev merged 3 commits into
mainfrom
agent/x99-claude-sonnet-200k/che-7080-ad466bf8e9b2

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Closes CHE-7080

Part of CHE-7064

Slice S1 of plan r3 (root CHE-6628).

What

GET /api/service/design-attestations/:id — registered before the /api session gate. Returns the session route's JSON plus pageIssueId (the attested page's current issueId, or null).

  • Authorization: Bearer <token> is compared with timingSafeEqual over SHA-256 digests. Missing or wrong token: 401. DOOP_ATTESTATION_READ_TOKEN unset: 503 for every request.
  • GET only; unknown id: 404.
  • DOOP_ATTESTATION_READ_TOKEN in server/env.ts (optional, at least 32 characters). .context/TECHSTACK.md names the route.

Environment documentation

.env.example now documents DOOP_ATTESTATION_READ_TOKEN, its 32-character minimum, and unset = 503 behavior. No token value is committed.

Test-first evidence

npx vitest run tests/designAttestationService.test.ts

Red (before the route; behavioural, server boots, route falls through to the session gate):

 ❯ tests/designAttestationService.test.ts (8 tests | 5 failed)
     × answers 503 to every request, with or without a token      (expected 503, got 401)
     × answers 404 for an unknown id                               (401)
     × returns the view with current true and pageIssueId ... (expected 200, got 401)
     × reports the attested page issue id once the page is bound
     × reports current false after a frame edit
 Tests  5 failed | 3 passed (8)

(The 3 passing then were the 401 cases and GET-only, which the session gate already answered. The "current true" fixture was widened afterwards to a complete page, because only a complete attestation can be current; its red was the same 401.)

Green (after):

 Test Files  2 passed (2)     # designAttestationService + existing designAttestation
      Tests  9 passed (9)

Covered: 503 unset, 401 missing, 401 wrong (also near-miss and no Bearer prefix), 404, 200 current: true, 200 current: false after an edit, pageIssueId null then set, DELETE refused.

Earlier author checks (ac9576f, historical; X99)

related-tests: 1 failed (the .env.example test above) / 696 passed; browser-tests SKIP; typecheck PASS; lint PASS; format PASS; doc-lint PASS; build SKIP.

Out of scope and untouched: G5 lock/pin, C00 config/secrets/deploy, writes to real canvases, design_card_guard.

Environment documentation correction — observed red then green (X99)

Head: 3d2fd5db215eb4163a349ddb3837805cce6f4af3.
Command for both runs: bun run test -- tests/env.test.ts.
The existing documentation-contract test was used; no new test was added.

Red, before the .env.example edit (exit 1):

FAIL tests/env.test.ts > server/env.ts > documents every declared variable in .env.example
AssertionError: expected [ 'DOOP_ATTESTATION_READ_TOKEN' ] to deeply equal []
Test Files  1 failed (1)
     Tests  1 failed | 7 passed (8)

Green, after the edit (exit 0):

Test Files  1 passed (1)
     Tests  8 passed (8)

Self-review: only .env.example changed in this correction; the entry follows the neighbouring optional-variable style, remains commented and empty, and matches server/env.ts and the route's error behavior. git diff --check passed. CI on this new head must be checked by the reviewer; earlier check results above apply to the previous head.

Update 22 Nov: CI fix on head 93fc96cf9082a59c193a9125a6870ddd84c599e2

Head 13cbd3d3 failed ci-policy and test (4). Cause: the branch was 44 commits behind main. The old ci.yml push trigger broke ci-policy R1 (fixed on main by #96). G3 ruleset g3-r7 on main attests only a page bound to an issue, with a requirement ledger read from Multica, so my test fixture was no longer complete (current: false).

  • Rebased onto main aa43b682 (clean; route and .env.example commits unchanged in content).
  • Test now binds the page to an issue, stubs Multica, adds the Motion and doc frames, and passes the sloplint results. pageIssueId set is asserted while bound; null after the page is unbound. The edit test runs before the unbind so current: false is caused by the edit.
  • Green: bun run test -- tests/designAttestationService.test.ts tests/env.test.ts tests/designAttestation.test.ts -> Test Files 3 passed (3), Tests 17 passed (17), run twice; bun run typecheck and bun run lint clean.
  • Red before the fix, on the rebased head: 1 failed | 7 passed (returns the view with current true ...).

Authorship: every commit on this head is Anthropic-authored (x99-claude-sonnet-200k). The OpenAI commit 3d2fd5db is gone. PR stays draft. An OpenAI reviewer signs the full head.

@congvc-bot-x99 congvc-bot-x99 Bot changed the title feat(doop): service read route for design attestations feat(doop): service read route for design attestations (CHE-7080) [squash] Nov 17, 2026
@congvc-bot-x99
congvc-bot-x99 Bot force-pushed the agent/x99-claude-sonnet-200k/che-7080-ad466bf8e9b2 branch from 3d2fd5d to 13cbd3d Compare November 22, 2026 00:55
@congvc-bot-x99
congvc-bot-x99 Bot force-pushed the agent/x99-claude-sonnet-200k/che-7080-ad466bf8e9b2 branch from 13cbd3d to 93fc96c Compare November 22, 2026 01:46
@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 22, 2026 04:12
@congvc-dev
congvc-dev added this pull request to the merge queue Nov 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 23, 2026
@congvc-dev
congvc-dev added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 1f728eb Nov 23, 2026
19 of 21 checks passed
@congvc-dev
congvc-dev deleted the agent/x99-claude-sonnet-200k/che-7080-ad466bf8e9b2 branch November 23, 2026 09:32
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.

1 participant