Cockpit D2 — evidence freshness projection - #49
Draft
LogicDuke wants to merge 1 commit into
Draft
Conversation
Cockpit D2: project PR 004 evidence-freshness answers for the evidence records of one already-validated CockpitSnapshot (Option A trust boundary). Repository identity and target HEAD come only from the enclosing snapshot; PR 004 remains the sole freshness authority. Presentation only: no authority, validation duplication, I/O, or new bound beyond D1. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cockpit D2 — evidence freshness projection
DRAFT. No Ready authority. No merge authority. No reviewer triggers.
Baseline
e1b1a2e5ab2422fbdddc63a7364a9b71bfc0e882(origin/main, PR PR004-F1 — isolate evidence freshness append descriptors #48 merge commit)28e06049a97210acb6edeb5acb0003340b3d26c3140e6225f61d4c8192de2820eb0a26a33c44c674(treee3b8c4716a554f055262316ce111efa70691444d)D2 single responsibility
Project PR 004 evidence-freshness answers for the evidence records contained in one already-validated
CockpitSnapshot. Presentation / observability only.Trust boundary — Option A
The public API consumes a
CockpitSnapshotthat has already passed D1'sreadCockpitSnapshot()boundary. D1 owns hostileunknowninput; D2 adds no second reader, noinvalidFieldsenvelope, no malformed-input pseudo-validation. A zero-result projection means the valid snapshot's evidence list is actually empty.One-way data flow
No reverse arrow.
Freshness kernel reuse (PR 004)
EvidenceRecord/EvidenceKind/EvidenceSourcefromsrc/domain/evidence.ts;EvidenceTarget/evaluateEvidenceSet/FreshnessState/FreshnessReason/FRESHNESSfromsrc/domain/evidence-freshness.ts. No SHA comparison in Cockpit;state/reason/invalidFieldscopied verbatim.Identity rules
repositoryIdfromsnapshot.repository.repositoryId(a D1 snapshot describes exactly one repository; the D1 read model is unchanged).EvidenceTargetis{ repositoryId: snapshot.repository.repositoryId, currentHeadSha: snapshot.repository.observedHeadSha }, read once into locals. No evidencecommitSha, advisory echo, finding, PR, reviewer, or metadata value can become HEAD.findings[*].advisoryFreshnessis never read.Public API
Flat, input-ordered
results+counts { current, stale, invalid, total }. No buckets. Deeply frozen, detached, JSON-round-trip stable, ambient-realm robust (captured intrinsics, null-proto records, insulated descriptors, listtoJSONshadow).Exact file scope (5 files)
docs/architecture/D2-cockpit-evidence-freshness-projection.mdsrc/cockpit/evidence-freshness-projection.tssrc/cockpit/index.tstests/cockpit/evidence-freshness-projection.test.tstests/cockpit/architecture-invariants.test.ts(exact single-name exception forprojectCockpitEvidenceFreshness; no generalproject*grant; authority-name checks unchanged)No D1 read-model modification. No domain kernel modification. No dependency change. No authority expansion. No new bound beyond D1's 1,000 evidence records.
Deterministic verification
git diff --check: cleanIndependent checks
claude -pprocess, no--resume, on the uncommitted candidate): VALIDATION = PASS (7 non-blocking observations; one doc wording note applied before commit)Untouched
🤖 Generated with Claude Code