-
Notifications
You must be signed in to change notification settings - Fork 1
feat(openspec): Add Tick-History Schema spec (B-0171.2) #5884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5726251
feat(openspec): Add Tick-History Schema spec (B-0171.2)
4cde693
Merge remote-tracking branch 'origin/main' into work-5884
947133f
fix(B-0171.2): markdownlint MD032 + regenerate BACKLOG index after ma…
d43848b
fix(B-0171.2): make tick-history spec discoverable + accurate (PR #58…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| --- | ||
| id: B-0171.2 | ||
| priority: P1 | ||
| status: open | ||
| title: "OpenSpec catch-up - author Tick-History Schema spec" | ||
| created: 2026-05-28 | ||
| last_updated: 2026-05-28 | ||
| parent: B-0171 | ||
| depends_on: [B-0171.1] | ||
| classification: buildable-now | ||
| decomposition: atomic | ||
| owners: [lior] | ||
| type: spec-authoring | ||
| --- | ||
|
|
||
| # B-0171.2 — Author Tick-History Schema spec | ||
|
|
||
| This task implements the second item from the Phase 1 audit of the OpenSpec catch-up project (B-0171). It involves creating a formal specification for the Tick-History Schema. | ||
|
|
||
| ## Scope | ||
|
|
||
| This task is focused on creating the OpenSpec document for the tick-history schema. The spec will define: | ||
|
|
||
| - The file and directory structure of tick-history shards. | ||
| - The shard filename grammar (`HHMMZ.md`, `HHMMZ-<hex>.md`, `HHMMSSZ-<hex>.md`). | ||
| - The pipe-row-first shard body format (tick shards carry no file-head frontmatter; the first non-empty line is a canonical table row). | ||
| - The invariants that are enforced by the hygiene tools (e.g., chronological order, timestamp-path congruence). | ||
|
|
||
| The implementation is a collection of tools under `tools/hygiene/`. This task is about formally documenting the existing behavior. | ||
|
|
||
| ## Acceptance Criteria | ||
|
|
||
| - A new spec file `openspec/specs/tick-history/spec.md` is created (so the capability is discovered by `tools/openspec/inventory.ts`, which scans `openspec/specs/*/spec.md`). | ||
| - The spec formally defines the tick-history schema using the canonical six-column row format (`date | agent | cron-id | action-summary | commit-or-link | notes`). | ||
| - The spec documents the pipe-row-first shard body format (no file-head frontmatter). | ||
| - The spec lists the invariants that are checked by the hygiene tools. | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| ## Purpose | ||
|
|
||
| The tick-history capability specifies the schema and invariants for the | ||
| tick-history, the primary auditable log of all autonomous agent operations in | ||
| the factory. It pins the observable structure of the two artifact families the | ||
| history is composed of — the append-only Tick History Log and the per-tick Tick | ||
| Shards — and the invariants the `tools/hygiene/` checkers enforce over them. | ||
| This spec is language-agnostic: it describes observable behaviour (file | ||
| locations, row formats, filename grammars, ordering invariants), not any | ||
| particular runtime or host-language surface. | ||
|
|
||
| **Parent:** B-0171.2 | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Requirement: Tick History Log row format | ||
|
|
||
| The canonical Tick History Log lives at | ||
| `docs/hygiene-history/loop-tick-history.md`. Each row MUST be a markdown table | ||
| row using the canonical six-column schema, matching the existing log header: | ||
|
|
||
| `| date (UTC ISO8601) | agent | cron-id | action-summary | commit-or-link | notes |` | ||
|
|
||
| - **date (UTC ISO8601):** An ISO-8601 timestamp in UTC, with minute or second | ||
| precision (e.g. `2026-05-28T12:34:56Z`). | ||
| - **agent:** The model + harness that performed the tick (e.g. | ||
| `opus-4-7 / autonomous-loop`). | ||
| - **cron-id:** The cron / fire identifier for the tick. | ||
| - **action-summary:** A brief one-line, human-readable summary of the tick's | ||
| actions. | ||
| - **commit-or-link:** The commit SHA or link produced by the tick. | ||
| - **notes:** Free-form notes. | ||
|
|
||
| #### Scenario: a log row carries the six canonical columns | ||
|
|
||
| - **WHEN** a row is appended to `docs/hygiene-history/loop-tick-history.md` | ||
| - **THEN** its first column MUST be a UTC ISO-8601 timestamp | ||
| - **AND** the row MUST carry at least the six canonical columns above | ||
|
|
||
| ### Requirement: Tick History Log chronological order | ||
|
|
||
| The `date` column MUST be non-decreasing when rows are read in file order. | ||
|
|
||
| #### Scenario: ordering is enforced | ||
|
|
||
| - **WHEN** `tools/hygiene/check-tick-history-order.ts` scans the log | ||
| - **THEN** any row whose timestamp is earlier than a preceding row's timestamp | ||
| is reported as a violation | ||
|
|
||
| ### Requirement: Tick Shard directory structure and filename grammar | ||
|
|
||
| Each tick generates a shard file stored under | ||
| `docs/hygiene-history/ticks/YYYY/MM/DD/`, where `YYYY`, `MM`, and `DD` are the | ||
| year, month, and day of the tick. The filename MUST match one of three forms | ||
| (as enforced by `tools/hygiene/check-tick-history-shard-schema.ts`): | ||
|
|
||
| - `HHMMZ.md` — hour+minute in UTC (e.g. `0754Z.md`). | ||
| - `HHMMZ-<hex>.md` — hour+minute with a lowercase-hex disambiguation suffix | ||
| (e.g. `0754Z-3f2a.md`). | ||
| - `HHMMSSZ-<hex>.md` — hour+minute+seconds with a hex suffix, for | ||
| high-concurrency ticks (e.g. `075412Z-3f2a.md`). | ||
|
|
||
| #### Scenario: a bare HHMMZ shard is accepted | ||
|
|
||
| - **WHEN** a shard is named `0754Z.md` under a `YYYY/MM/DD` path | ||
| - **THEN** the schema checker accepts the filename | ||
|
|
||
| #### Scenario: a seconds+hash shard is accepted | ||
|
|
||
| - **WHEN** a high-concurrency shard is named `075412Z-3f2a.md` | ||
| - **THEN** the schema checker accepts the filename | ||
|
|
||
| #### Scenario: a non-conforming filename is rejected | ||
|
|
||
| - **WHEN** a shard filename matches none of the three forms | ||
| - **THEN** the schema checker reports `filename does not match HHMMZ.md, | ||
| HHMMZ-<hex>.md, or HHMMSSZ-<hex>.md` | ||
|
|
||
| ### Requirement: Tick Shard content is pipe-row-first with no frontmatter | ||
|
|
||
| Tick shards do NOT carry file-head YAML frontmatter. The first non-empty line | ||
| of a shard MUST be a markdown table row that matches the Tick History Log row | ||
| format (the six canonical columns above), and its first column's timestamp MUST | ||
| agree with the date and time encoded in the shard's directory path and | ||
| filename. Both invariants are enforced by | ||
| `tools/hygiene/check-tick-history-shard-schema.ts`. | ||
|
|
||
| #### Scenario: first non-empty line is a pipe row | ||
|
|
||
| - **WHEN** a shard file is scanned | ||
| - **THEN** its first non-empty line MUST begin a markdown table row whose first | ||
| column is a UTC ISO-8601 timestamp | ||
| - **AND** the shard MUST NOT begin with YAML frontmatter | ||
|
|
||
| #### Scenario: timestamp-path congruence | ||
|
|
||
| - **WHEN** the first column's timestamp is compared to the shard's | ||
| `YYYY/MM/DD/HHMM` path | ||
| - **THEN** the date and time MUST agree, or the checker reports a congruence | ||
| violation |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.