Documentation
¶
Overview ¶
Command gen-activitylog renders the activity-log reader schema (schema.go, the single field authority) into the checked-in reader-side Go sources: the private decode struct activityRawLine, the exported ActivityEntry, and the toEntry copier that bridges them.
DRY: activity.jsonl, the --json StreamEvent wire, and this reader are three shapes for one datum. Before this generator the reader half repeated the flat field list three times (struct tags, exported fields, and hand-written copy code), guarded only by mechanical parity tests. Now the field list lives once in schema.go and the three reader artifacts are derived from it, so a new field cannot land on two of the three and drift.
The output is drift-gated by scripts/docs/gate.sh activity-schema (wired into pre-commit + CI via `make docs-check`): editing schema.go without regenerating, or hand-editing the generated files, fails the gate until `make gen-activity-schema` is re-run and the result committed.
Run: make gen-activity-schema (or: go run ./scripts/gen/activitylog)
ABOUTME: The single field authority for the activity-log reader schema. ABOUTME: One entry per activity.jsonl field; the generator derives the three ABOUTME: reader-side artifacts (activityRawLine, ActivityEntry, toEntry) from it.