HW-10: add canonical registry-v2 identity and drift detection#154
Closed
skylarbpayne wants to merge 3 commits into
Closed
HW-10: add canonical registry-v2 identity and drift detection#154skylarbpayne wants to merge 3 commits into
skylarbpayne wants to merge 3 commits into
Conversation
Owner
Author
|
Closing unmerged pending a ground-up reassessment of the remediation scope and process. Do not continue this execution plan. |
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.
Scope
Implements the issue-owned canonical registry-v2 catalog contract on exact framework base
4bcc29073668b7275d72bff2e341f0ab52899fb9.Head:
912e4ba4431201150fbf7a3ac31c5007a9e7d636Exact seven paths:
src/hermes_workflows/registry_v2.pytests/test_registry_v2_contract.pytests/contracts/test_registry_consumer_contract.pytests/fixtures/registry_v2_valid.jsontests/fixtures/registry_v2_drift.jsontests/fixtures/registry_v1_legacy.jsondocs/contracts/registry-v2.mdNo consumer adapter, shared registry/CLI/plugin/worker/status path, Palmer path, or live state was changed.
Contract
schema_version,state_root, object-formdbs, canonicalworkflows.workflow_ref, and explicitrunnerpolicy.registry.identityservice contract for future CLI/plugin/supervisor adapters.TDD receipt
Expected red observed on both runtimes before
registry_v2.pyexisted:Green:
The first GitHub Python 3.11 run caught a version-specific dataclass default rejection. Commit
912e4ba4431201150fbf7a3ac31c5007a9e7d636replaced the sharedMappingProxyTypedefault withfield(default_factory=...); Python 3.9, 3.11, and 3.12 full suites then passed at the final head.V1 → v2 dry-run JSON
{"schema_version":1,"source_schema_version":1,"target_fingerprint":"sha256:4a350fb22b93fc5da90ecb45d80fb98961835b1a6ccd79bccb2e03dcbb61e3c8","target_registry":{"dbs":{"audit":{"path":"audit/workflows.sqlite"},"primary":{"path":"primary/workflows.sqlite"}},"runner":{"dbs":["audit","primary"],"lease_seconds":30},"schema_version":2,"state_root":"state","workflows":{"audit-workflow":{"db":"audit","tags":["audit","review"],"title":"Audit workflow","workflow_ref":"example_workflows.audit:audit_workflow"},"review-workflow":{"db":"primary","default_input":{"mode":"review"},"defaults_overlay":"local","description":"A deterministic registry-v2 contract fixture.","tags":["review","workflow"],"title":"Review workflow","trusted_resume":true,"workflow_ref":"example_workflows.review:review_workflow"}}},"target_schema_version":2,"would_write":false}The source fixture bytes were unchanged before/after this dry run.
Consumer parity JSON
One temp-root service returned the exact same object to simulated CLI/plugin/supervisor consumers:
{"db_alias":"primary","registry_fingerprint":"sha256:4a350fb22b93fc5da90ecb45d80fb98961835b1a6ccd79bccb2e03dcbb61e3c8","registry_identity":"sha256:9daee56a4bca8b986fedc57e3ce0c61257eb3e6c582ef70c7cca01850a9b44d2","resolved_db_identity":"sha256:89cefd5f6899b52a49ce457513746d6910b8b0ef02f5843fd8e1a948b26945d5","schema_version":1}No registry path, DB filename, workflow defaults, or secret/private value is present.
Drift, redaction, and traversal evidence
{"drift":{"code":"registry_drift","conflict_id":null,"exit_code":2,"fields":{"consumers":["cli","supervisor"]},"message":"registry consumers do not share one registry identity"},"redaction":{"db_filename_absent":true,"private_temp_root_absent":true},"traversal":{"code":"registry_invalid","conflict_id":null,"exit_code":2,"fields":{},"message":"registry does not satisfy the canonical registry-v2 contract"}}Tests also cover registry-file symlinks, state-root symlinks, DB-component symlinks, absolute/home/drive/backslash paths, parent traversal, duplicate JSON keys, duplicate runner IDs, unknown DB references, raw public paths, and bounded secret-free diagnostics.
Fixture SHA-256
Immutable prerequisites and non-mutation receipt
ad9e83091d72cab2f79b8324944d1dea4b740951remains an ancestor.fc9eb5ae0797c5cbdfcf51d6b9be551e6ba85331is not an ancestor.6d77e020f4c7c7974491a985fc764c449163c643, qualified merge/current-mainf1fc35148721d57224a3286f02f6537f05d21eaf, for the documented registry-file/state-root/relative-DB relocation boundary only.Do not merge before the controller-owned independent SR and separate QR.