From d929f4f011789d23d609a6fd1f4dad84791c14cb Mon Sep 17 00:00:00 2001 From: Wonderforge <74642251+Wonderforge-Lab@users.noreply.github.com> Date: Thu, 10 Sep 2026 17:02:29 -0700 Subject: [PATCH] Fix minimal routine deposit example for Registry v1 --- examples/minimal_routine_deposit/README.md | 18 +++++++++- .../datadrop_packet.md | 13 ++++--- .../packet_record.json | 15 ++++++-- examples/minimal_routine_deposit/signoff.md | 6 ++-- .../minimal_routine_deposit/visit_record.json | 6 ++-- tests/test_validator_smoke.py | 35 +++++++++++++++++++ 6 files changed, 80 insertions(+), 13 deletions(-) diff --git a/examples/minimal_routine_deposit/README.md b/examples/minimal_routine_deposit/README.md index e45917b..83b9be5 100644 --- a/examples/minimal_routine_deposit/README.md +++ b/examples/minimal_routine_deposit/README.md @@ -12,5 +12,21 @@ The example demonstrates: - JSON packet record creation. - JSON visit record creation. - Signoff creation from the current `templates/visit_signoff.md` shape. -- No CSV registry edit. +- Regenerated compatibility views, with no manual CSV registry edit. - No task branch for ordinary live-workspace runtime work. + +The fictional operator wrote the report; the visitor deposits it. These provenance +values describe this example, not the authorship of every future deposit. + +In a disposable copy, place the packet at the JSON record's `path`, the signoff +at `signoff_path`, and the JSON files under `registry/packets/2026/` and +`registry/visits/2026/`, named after their respective IDs. Then run: + +```sh +python scripts/generate_registry_views.py +python scripts/validate_repo.py --registry +python scripts/generate_registry_views.py --check +``` + +The validator smoke suite tests this exact copy-and-validate sequence in a +temporary workspace. Do not put test deposits in the public source repository. diff --git a/examples/minimal_routine_deposit/datadrop_packet.md b/examples/minimal_routine_deposit/datadrop_packet.md index 1fa9deb..efa16e9 100644 --- a/examples/minimal_routine_deposit/datadrop_packet.md +++ b/examples/minimal_routine_deposit/datadrop_packet.md @@ -3,8 +3,13 @@ packet_id: 20260603-example-visitor-routine-test source_session: example-visitor target_session: Shared -created_by: example-visitor -created_at: 2026-06-03 +created_by: example-operator +deposited_by: example-visitor +created_at: 2026-06-03T12:00:00Z +content_origin: operator_authored +source_refs: [] +derivative_of: [] +provenance_coverage: record_level status: new topic: routine-test purpose: Demonstrate the routine deposit quickstart. @@ -16,7 +21,7 @@ related_packets: ## Context -This is a fictional example for ordinary visitor deposits in a controlled live workspace. +This is a fictional example for ordinary visitor deposits in a controlled live workspace. The operator wrote the report; the visitor deposits it with the operator's approval. ## Task @@ -36,4 +41,4 @@ Optional review note. ## Notes -This example does not require a branch or CSV registry update. +This example does not require a task branch. Regenerate the compatibility views after adding the JSON records; do not edit CSV files manually. diff --git a/examples/minimal_routine_deposit/packet_record.json b/examples/minimal_routine_deposit/packet_record.json index a8ede0d..1a8832e 100644 --- a/examples/minimal_routine_deposit/packet_record.json +++ b/examples/minimal_routine_deposit/packet_record.json @@ -1,8 +1,17 @@ { + "record_type": "packet", + "schema_version": 1, "packet_id": "20260603-example-visitor-routine-test", - "date": "2026-06-03", - "source_ai": "ExampleAI", - "target_ai": "Shared", + "created_at": "2026-06-03T12:00:00Z", + "created_by": "example-operator", + "deposited_by": "example-visitor", + "content_origin": "operator_authored", + "source_refs": [], + "source_note": "Fictional scenario: the operator wrote the report and the visitor deposited it.", + "derivative_of": [], + "provenance_coverage": "record_level", + "source_session": "example-visitor", + "target_session": "Shared", "topic": "routine-test", "status": "new", "path": "datadrops/shared/inbox/20260603-example-visitor-routine-test.md", diff --git a/examples/minimal_routine_deposit/signoff.md b/examples/minimal_routine_deposit/signoff.md index dca92df..8cea500 100644 --- a/examples/minimal_routine_deposit/signoff.md +++ b/examples/minimal_routine_deposit/signoff.md @@ -1,13 +1,13 @@ # Visit Signoff visit_id: 20260603-example-visitor-routine-test-visit -date: 2026-06-03 +created_at: 2026-06-03T12:00:00Z visitor_id: example-visitor session_family: example-ai checked_messages: true answered_messages: false created_messages: false -human_relay_needed: false +relay_needed: false signoff_path: responses/signoffs/20260603-example-visitor-routine-test-signoff.md ## Work Completed @@ -15,7 +15,7 @@ signoff_path: responses/signoffs/20260603-example-visitor-routine-test-signoff.m - Created a fictional routine deposit packet using the current Markdown template shape. - Created the canonical JSON packet record. - Created the canonical JSON visit record. -- Did not edit CSV registries. +- Regenerated compatibility views without manually editing CSV registries. - Did not create a task branch for ordinary live-workspace runtime work. ## Open Items diff --git a/examples/minimal_routine_deposit/visit_record.json b/examples/minimal_routine_deposit/visit_record.json index dde2278..9e91d2e 100644 --- a/examples/minimal_routine_deposit/visit_record.json +++ b/examples/minimal_routine_deposit/visit_record.json @@ -1,8 +1,10 @@ { + "record_type": "visit", + "schema_version": 1, "visit_id": "20260603-example-visitor-routine-test-visit", - "date": "2026-06-03", + "created_at": "2026-06-03T12:00:00Z", "visitor_id": "example-visitor", - "visitor_family": "example-ai", + "session_family": "example-ai", "checked_messages": true, "answered_messages": false, "created_messages": false, diff --git a/tests/test_validator_smoke.py b/tests/test_validator_smoke.py index eed4658..9515f22 100644 --- a/tests/test_validator_smoke.py +++ b/tests/test_validator_smoke.py @@ -3,6 +3,8 @@ from __future__ import annotations import subprocess +import json +import shutil import sys import tempfile from pathlib import Path @@ -167,7 +169,40 @@ def assert_direct_validator_invariants() -> None: ) +def assert_minimal_routine_deposit() -> None: + """Validate the shipped specimen at its real destination paths, without repair.""" + example = ROOT / "examples" / "minimal_routine_deposit" + with tempfile.TemporaryDirectory() as temporary: + workspace = Path(temporary) / "workspace" + shutil.copytree(ROOT, workspace, ignore=shutil.ignore_patterns(".git", "__pycache__")) + for filename, kind, id_key, artifact, path_key in ( + ("packet_record.json", "packets", "packet_id", "datadrop_packet.md", "path"), + ("visit_record.json", "visits", "visit_id", "signoff.md", "signoff_path"), + ): + record = json.loads((example / filename).read_text(encoding="utf-8")) + destination = workspace / "registry" / kind / record[id_key][:4] + destination.mkdir(parents=True, exist_ok=True) + shutil.copy2(example / filename, destination / (record[id_key] + ".json")) + artifact_path = workspace / record[path_key] + artifact_path.parent.mkdir(parents=True, exist_ok=True) + shutil.copy2(example / artifact, artifact_path) + for args in ( + ("scripts/generate_registry_views.py",), + ("scripts/validate_repo.py", "--registry"), + ("scripts/generate_registry_views.py", "--check"), + ): + result = subprocess.run( + [sys.executable, *args], cwd=workspace, text=True, + capture_output=True, check=False, + ) + if result.returncode: + raise AssertionError( + f"minimal routine deposit failed: {args}\n{result.stdout}\n{result.stderr}" + ) + + def main() -> int: + assert_minimal_routine_deposit() assert_direct_validator_invariants() assert_valid( "valid schema fixtures", "--fixtures", "--check-references", "--check-tags"