Skip to content

Commit 18cef0d

Browse files
Fix minimal routine deposit example for Registry v1 (#38)
1 parent 9e8a6d5 commit 18cef0d

6 files changed

Lines changed: 80 additions & 13 deletions

File tree

‎examples/minimal_routine_deposit/README.md‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,21 @@ The example demonstrates:
1212
- JSON packet record creation.
1313
- JSON visit record creation.
1414
- Signoff creation from the current `templates/visit_signoff.md` shape.
15-
- No CSV registry edit.
15+
- Regenerated compatibility views, with no manual CSV registry edit.
1616
- No task branch for ordinary live-workspace runtime work.
17+
18+
The fictional operator wrote the report; the visitor deposits it. These provenance
19+
values describe this example, not the authorship of every future deposit.
20+
21+
In a disposable copy, place the packet at the JSON record's `path`, the signoff
22+
at `signoff_path`, and the JSON files under `registry/packets/2026/` and
23+
`registry/visits/2026/`, named after their respective IDs. Then run:
24+
25+
```sh
26+
python scripts/generate_registry_views.py
27+
python scripts/validate_repo.py --registry
28+
python scripts/generate_registry_views.py --check
29+
```
30+
31+
The validator smoke suite tests this exact copy-and-validate sequence in a
32+
temporary workspace. Do not put test deposits in the public source repository.

‎examples/minimal_routine_deposit/datadrop_packet.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
packet_id: 20260603-example-visitor-routine-test
44
source_session: example-visitor
55
target_session: Shared
6-
created_by: example-visitor
7-
created_at: 2026-06-03
6+
created_by: example-operator
7+
deposited_by: example-visitor
8+
created_at: 2026-06-03T12:00:00Z
9+
content_origin: operator_authored
10+
source_refs: []
11+
derivative_of: []
12+
provenance_coverage: record_level
813
status: new
914
topic: routine-test
1015
purpose: Demonstrate the routine deposit quickstart.
@@ -16,7 +21,7 @@ related_packets:
1621

1722
## Context
1823

19-
This is a fictional example for ordinary visitor deposits in a controlled live workspace.
24+
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.
2025

2126
## Task
2227

@@ -36,4 +41,4 @@ Optional review note.
3641

3742
## Notes
3843

39-
This example does not require a branch or CSV registry update.
44+
This example does not require a task branch. Regenerate the compatibility views after adding the JSON records; do not edit CSV files manually.

‎examples/minimal_routine_deposit/packet_record.json‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
{
2+
"record_type": "packet",
3+
"schema_version": 1,
24
"packet_id": "20260603-example-visitor-routine-test",
3-
"date": "2026-06-03",
4-
"source_ai": "ExampleAI",
5-
"target_ai": "Shared",
5+
"created_at": "2026-06-03T12:00:00Z",
6+
"created_by": "example-operator",
7+
"deposited_by": "example-visitor",
8+
"content_origin": "operator_authored",
9+
"source_refs": [],
10+
"source_note": "Fictional scenario: the operator wrote the report and the visitor deposited it.",
11+
"derivative_of": [],
12+
"provenance_coverage": "record_level",
13+
"source_session": "example-visitor",
14+
"target_session": "Shared",
615
"topic": "routine-test",
716
"status": "new",
817
"path": "datadrops/shared/inbox/20260603-example-visitor-routine-test.md",

‎examples/minimal_routine_deposit/signoff.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Visit Signoff
22

33
visit_id: 20260603-example-visitor-routine-test-visit
4-
date: 2026-06-03
4+
created_at: 2026-06-03T12:00:00Z
55
visitor_id: example-visitor
66
session_family: example-ai
77
checked_messages: true
88
answered_messages: false
99
created_messages: false
10-
human_relay_needed: false
10+
relay_needed: false
1111
signoff_path: responses/signoffs/20260603-example-visitor-routine-test-signoff.md
1212

1313
## Work Completed
1414

1515
- Created a fictional routine deposit packet using the current Markdown template shape.
1616
- Created the canonical JSON packet record.
1717
- Created the canonical JSON visit record.
18-
- Did not edit CSV registries.
18+
- Regenerated compatibility views without manually editing CSV registries.
1919
- Did not create a task branch for ordinary live-workspace runtime work.
2020

2121
## Open Items

‎examples/minimal_routine_deposit/visit_record.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
2+
"record_type": "visit",
3+
"schema_version": 1,
24
"visit_id": "20260603-example-visitor-routine-test-visit",
3-
"date": "2026-06-03",
5+
"created_at": "2026-06-03T12:00:00Z",
46
"visitor_id": "example-visitor",
5-
"visitor_family": "example-ai",
7+
"session_family": "example-ai",
68
"checked_messages": true,
79
"answered_messages": false,
810
"created_messages": false,

‎tests/test_validator_smoke.py‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from __future__ import annotations
44

55
import subprocess
6+
import json
7+
import shutil
68
import sys
79
import tempfile
810
from pathlib import Path
@@ -167,7 +169,40 @@ def assert_direct_validator_invariants() -> None:
167169
)
168170

169171

172+
def assert_minimal_routine_deposit() -> None:
173+
"""Validate the shipped specimen at its real destination paths, without repair."""
174+
example = ROOT / "examples" / "minimal_routine_deposit"
175+
with tempfile.TemporaryDirectory() as temporary:
176+
workspace = Path(temporary) / "workspace"
177+
shutil.copytree(ROOT, workspace, ignore=shutil.ignore_patterns(".git", "__pycache__"))
178+
for filename, kind, id_key, artifact, path_key in (
179+
("packet_record.json", "packets", "packet_id", "datadrop_packet.md", "path"),
180+
("visit_record.json", "visits", "visit_id", "signoff.md", "signoff_path"),
181+
):
182+
record = json.loads((example / filename).read_text(encoding="utf-8"))
183+
destination = workspace / "registry" / kind / record[id_key][:4]
184+
destination.mkdir(parents=True, exist_ok=True)
185+
shutil.copy2(example / filename, destination / (record[id_key] + ".json"))
186+
artifact_path = workspace / record[path_key]
187+
artifact_path.parent.mkdir(parents=True, exist_ok=True)
188+
shutil.copy2(example / artifact, artifact_path)
189+
for args in (
190+
("scripts/generate_registry_views.py",),
191+
("scripts/validate_repo.py", "--registry"),
192+
("scripts/generate_registry_views.py", "--check"),
193+
):
194+
result = subprocess.run(
195+
[sys.executable, *args], cwd=workspace, text=True,
196+
capture_output=True, check=False,
197+
)
198+
if result.returncode:
199+
raise AssertionError(
200+
f"minimal routine deposit failed: {args}\n{result.stdout}\n{result.stderr}"
201+
)
202+
203+
170204
def main() -> int:
205+
assert_minimal_routine_deposit()
171206
assert_direct_validator_invariants()
172207
assert_valid(
173208
"valid schema fixtures", "--fixtures", "--check-references", "--check-tags"

0 commit comments

Comments
 (0)