Skip to content

Hash lifecycle operability evidence at the descriptor-safe read boundary - #579

Merged
seonghobae merged 5 commits into
mainfrom
feat/lifecycle-operability-retained-digest
Sep 9, 2026
Merged

Hash lifecycle operability evidence at the descriptor-safe read boundary#579
seonghobae merged 5 commits into
mainfrom
feat/lifecycle-operability-retained-digest

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Buyer/runtime gap

#561 requires lifecycle operability evidence to be cryptographically bound to the exact retained bytes. Protected main@32537d9b1f420666bf97c455c3f9a09fc17d0be1 could parse descriptor-safe retained JSON and #578 could consume a caller-supplied digest, but the operability audit did not yet compute that digest from the same descriptor read.

RED → causal repair

The first commit added a regression requiring a retained-evidence SHA-256 API that performs exactly one descriptor-safe read and withholds any digest for duplicate-key JSON. A second regression requires the bounded lifecycle audit output to expose only that digest, never the evidence pathname or raw latency samples.

The implementation now:

  • adds readStrictJsonEvidenceWithSha256, hashing the exact Buffer already used for fatal UTF-8 decoding, duplicate-key rejection and JSON.parse;
  • avoids a second pathname read, so parse identity and digest identity cannot diverge through a local TOCTOU window;
  • emits evidence_sha256 from operations:lifecycle-operability only after strict evidence collection succeeds;
  • keeps rejected evidence digest-less and preserves the existing bounded output contract;
  • documents that this digest is artifact identity, not producer authentication, and must be fed into the Bind lifecycle operability evidence to deployment authority #578 deployment-authority/attestation gate.

Remaining acceptance

This Draft does not close #561. A trusted release/deployment workflow still must produce or collect the actual remote Durable Object evidence, attest those exact retained bytes, cryptographically verify that attestation, retain the verification receipt, and then run the deployment-authority gate. Real p95/storage/contention/recovery evidence and immutable release provenance remain required.

Summary by CodeRabbit

  • 새 기능

    • 엄격히 검증된 증거에 대해 원본 바이트의 SHA-256 다이제스트를 감사 결과에 포함합니다.
    • 검증에 성공한 증거만 다이제스트를 표시하며, 판독 실패나 중복 키가 있는 경우에는 다이제스트를 표시하지 않습니다.
    • 감사 결과에 민감한 경로와 대기 시간 정보가 노출되지 않도록 했습니다.
  • 문서

    • 증거 무결성 검증 및 배포 승인 절차를 위한 요구사항을 명확히 했습니다.
  • 테스트

    • 다이제스트 생성, 단일 바이트 읽기, 엄격한 JSON 검증 및 실패 시 동작을 추가로 확인합니다.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f11c6dc6-1b42-4326-9e66-6749d8f36a35

📥 Commits

Reviewing files that changed from the base of the PR and between 32537d9 and 3a475f1.

📒 Files selected for processing (5)
  • docs/doctoring/external-extension-lifecycle-operability-evidence.md
  • scripts/external-extension-lifecycle-operability-audit.mjs
  • scripts/lib/strict-json-evidence.mjs
  • test/external-extension-lifecycle-operability-audit-digest.test.ts
  • test/external-extension-lifecycle-retained-digest.test.ts

📝 Walkthrough

Walkthrough

엄격한 JSON 증거 판독기가 검증된 원본 바이트의 SHA-256을 계산합니다. 감사 출력은 성공한 증거의 다이제스트를 포함하고 실패 시 null을 출력합니다. 테스트와 운영 문서는 단일 읽기 및 배포 증명 규칙을 반영합니다.

Changes

증거 다이제스트 검증

Layer / File(s) Summary
엄격한 판독과 보존 바이트 해시
scripts/lib/strict-json-evidence.mjs, test/external-extension-lifecycle-retained-digest.test.ts
판독기는 검증을 통과한 원본 바이트를 한 번 읽고 SHA-256을 계산합니다. 중복 키 JSON은 duplicate_keys 오류와 함께 다이제스트 없이 거부됩니다.
감사 출력의 다이제스트 통합
scripts/external-extension-lifecycle-operability-audit.mjs, test/external-extension-lifecycle-operability-audit-digest.test.ts
감사 CLI는 SHA-256 판독기를 사용합니다. 성공한 출력에는 evidence_sha256status만 포함되고 실패 시 다이제스트는 null입니다.
운영 증거 계약 갱신
docs/doctoring/external-extension-lifecycle-operability-evidence.md
문서는 보존 바이트의 다이제스트, 정확한 바이트에 대한 배포 증명, 검증 영수증, 두 번째 경로 읽기 금지 규칙을 정의합니다.

Estimated code review effort: 2 (Simple) | ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/lifecycle-operability-retained-digest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

feat(tool-capability): persist append-only external-extension lifecycle evidence

1 participant