Skip to content

docs(spec): add glossary and format ADRs#3

Merged
somus merged 2 commits into
mainfrom
somus/atf-12-spec-docs
Jun 12, 2026
Merged

docs(spec): add glossary and format ADRs#3
somus merged 2 commits into
mainfrom
somus/atf-12-spec-docs

Conversation

@somus

@somus somus commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Summary

  • Add a spec-only glossary under docs/GLOSSARY.md.
  • Add compactly renumbered format ADRs under docs/adr/.
  • Link the glossary and ADR directory from the README repository map.

Related Issue

  • ATF-12
  • ATF-13 deferred.

Public Impact

  • No public contract change
  • Spec or schema change
  • Public package API change
  • CLI behavior change
  • Public URL or docs behavior change

Impact description:

  • Documentation-only addition for public spec terminology and historical format decisions.
  • No schema, fixture, package API, or CLI behavior changes.

Verification

  • rg -n "GitHub issue|github issue|#[0-9]+|Closes|Tracks|issue|issues|PR" docs/adr - no matches.
  • rg -n "Parser Source Matrix|Local store|Finalized object|Index|redaction-patterns" docs/GLOSSARY.md - no matches.
  • rg -n "ADR-000[1-8]" docs/adr docs/GLOSSARY.md README.md - confirms compact ADR references.
  • mise run check - passed.

Reviewer Notes

  • Old monorepo ADR-0002, ADR-0003, and ADR-0010 were intentionally not ported.
  • Ported ADRs remove GitHub issue references and implementation-only package details.
  • ATF-13 remains deferred until release artifact policy is settled.

Open in Stage

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@somus, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 48 minutes and 57 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b55baf85-b694-416e-826e-faad1ea286d2

📥 Commits

Reviewing files that changed from the base of the PR and between a9bb695 and 1d3b235.

📒 Files selected for processing (4)
  • docs/GLOSSARY.md
  • docs/adr/0002-trail-envelope-and-two-tier-identity.md
  • docs/adr/0005-session-bundles-and-child-sessions.md
  • docs/adr/0008-enum-extensibility-policy.md
📝 Walkthrough

Walkthrough

This pull request adds foundational specification documentation for the Agent Trail format. It introduces a shared glossary, establishes schema.json as the canonical contract, defines file envelope and multi-segment session structures, and specifies reconciliation semantics and extensibility policies through eight architecture decision records.

Changes

Agent Trail Specification Documentation

Layer / File(s) Summary
Glossary and documentation index
README.md, docs/GLOSSARY.md
Comprehensive glossary defining Agent Trail terminology (format contracts, validation strictness, trail envelopes, session identity, content hashing) with relationship rules and flagged ambiguities. README updated to reference new glossary and ADR directory.
Format contract and core structural decisions
docs/adr/0001-schema-json-is-the-format-contract.md, docs/adr/0002-trail-envelope-and-two-tier-identity.md, docs/adr/0005-session-bundles-and-child-sessions.md
Schema.json established as canonical machine-readable contract with derived artifacts. Optional trail envelope at line 1 carries file-level metadata and content hash. Session bundles enable multiple session groups per file with child sessions linked via durable fork_from edges.
Multi-segment session primitives and reconciliation
docs/adr/0003-multi-segment-session-primitives.md, docs/adr/0004-segment-reconciliation-and-event-id-policy.md
Session header fields (session_uid, segment.seq, segment.prev_content_hash) enable multi-segment grouping. Reconciliation semantics: group by session_uid, validate content hash chain links, concatenate and deduplicate events by canonical id, build merged session header from first/last segment fields.
Event provenance and enum extensibility policies
docs/adr/0006-context-compact-replaced-message-provenance.md, docs/adr/0007-v0.1-draft-hardening-decisions.md, docs/adr/0008-enum-extensibility-policy.md
Optional replaced_message_ids field on context_compact events tracks replacement provenance without full validation. Usage tokens placed only on first derived entry supporting usage. Enum extensibility: structural discriminators remain closed; descriptive enums extensible via reserved values and x-/ namespacing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 With whiskers twitched and ears held high,
We glossarize beneath the sky—
ADRs sprouted, eight in all,
Building schemas, standing tall!
Now trails align and segments dance,
A spec reborn, a format's chance.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding a glossary and format ADRs to the documentation.
Description check ✅ Passed The description is clearly related to the changeset, providing summary, issue references, public impact assessment, and verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch somus/atf-12-spec-docs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stage-review

stage-review Bot commented Jun 12, 2026

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 3 individual chapters for you:

Title
1 Define shared terminology in GLOSSARY.md
2 Port and renumber format ADRs
3 Link documentation in README
Open in Stage

Chapters generated by Stage for commit 1d3b235 on Jun 12, 2026 6:40pm UTC.

@somus somus marked this pull request as ready for review June 12, 2026 18:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/adr/0002-trail-envelope-and-two-tier-identity.md`:
- Around line 9-10: The term "file label" is undefined and ambiguous in the
trail envelope description (the `type:"trail"` record); either add a concise
definition for "file label" in this ADR clarifying whether it is a human-facing
display name, a unique envelope identifier, or a schema/key field, or replace
every occurrence of "file label" with the existing, precise term used elsewhere
in the spec (e.g., "envelope id" or "display name") and update the
`type:"trail"` record description accordingly so implementers know its purpose
and format.

In `@docs/adr/0005-session-bundles-and-child-sessions.md`:
- Around line 11-19: The field name fork_from.session_id is ambiguous vs the
per-artifact "session id" (session_uid); rename or explicitly define it as a
durable parent-session reference (e.g., parent_session_id or parent_header_id)
and update the JSON example and glossary text to state that this identifier is
an Agent Trail durable header id (not the runtime session_uid), while runtime
IDs remain in metadata/source.raw; ensure you also mention entry_id and
content_hash are optional and that this parent_session_id represents the durable
parent session identifier family to avoid implementer confusion.

In `@docs/adr/0008-enum-extensibility-policy.md`:
- Around line 13-15: Update the ADR wording for the extensible vocabulary list
to clarify that the `agent.name` slot accepts either a canonical registry value
or a vendor-namespaced extension of the form `x-<vendor>/<name>`; explicitly
state the two-part contract (registered canonical names vs. opaque passthrough
for `x-...` extensions) and mirror the same grammar/reader behavior language
used for other slots like `scope` and `system_event.kind` so readers treat
unknown `x-<vendor>/<name>` `agent.name` values as opaque strings that are
passed through.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6895c990-70f3-4c6f-84ed-1e56c3efaa21

📥 Commits

Reviewing files that changed from the base of the PR and between 137862b and a9bb695.

📒 Files selected for processing (10)
  • README.md
  • docs/GLOSSARY.md
  • docs/adr/0001-schema-json-is-the-format-contract.md
  • docs/adr/0002-trail-envelope-and-two-tier-identity.md
  • docs/adr/0003-multi-segment-session-primitives.md
  • docs/adr/0004-segment-reconciliation-and-event-id-policy.md
  • docs/adr/0005-session-bundles-and-child-sessions.md
  • docs/adr/0006-context-compact-replaced-message-provenance.md
  • docs/adr/0007-v0.1-draft-hardening-decisions.md
  • docs/adr/0008-enum-extensibility-policy.md

Comment thread docs/adr/0002-trail-envelope-and-two-tier-identity.md Outdated
Comment thread docs/adr/0005-session-bundles-and-child-sessions.md
Comment thread docs/adr/0008-enum-extensibility-policy.md Outdated
@somus somus merged commit 87c9a66 into main Jun 12, 2026
2 checks passed
@somus somus deleted the somus/atf-12-spec-docs branch June 13, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant