Skip to content

docs: define Hill 1 semantic bootstrap slice#308

Merged
flyingrobots merged 6 commits intomainfrom
feat/h1-bootstrap-spec
Mar 25, 2026
Merged

docs: define Hill 1 semantic bootstrap slice#308
flyingrobots merged 6 commits intomainfrom
feat/h1-bootstrap-spec

Conversation

@flyingrobots
Copy link
Owner

PR Title

docs: define Hill 1 semantic bootstrap slice

Summary

  • add a canonical Hill 1 semantic bootstrap spec at docs/design/h1-semantic-bootstrap.md
  • move the roadmap's active focus from generic clarification work to the actual Hill 1 product slice
  • add the Hill 1 spec to the canonical documentation map
  • cut and cross-link follow-on execution issues #304 through #307 from the accepted first-slice framing

Problem Statement

Git Mind's product frame and planning model were clarified, but the repo still lacked a concrete first-slice spec for the actual product move that matters: point Git Mind at an unfamiliar repository and get a useful first semantic map with low manual input. Without that spec, the backlog remained tilted toward supporting work while the core Hill 1 product slice stayed underspecified.

ADR Compliance (Required)

Relevant ADR(s)

  • ADR-0002 (Worktree Independence and Materialization Architecture)
  • ADR-0003 (Graph-Native Content, Deterministic Materialization, and Workspace Bridge)
  • None

Compliance Declaration

  • This PR is fully compliant with all checked ADRs.
  • This PR intentionally deviates from one or more checked ADRs (complete Exception Request below).

Exception Request (Required if deviating)

  • ADR clause(s) deviated from: N/A
  • Why deviation is necessary now: N/A
  • Risk introduced by deviation: N/A
  • Mitigation and rollback plan: N/A
  • Follow-up ADR/issue to reconcile architecture debt: N/A

Architecture Laws Checklist (Hard Gates)

Canonical Truth & Context

  • Graph remains canonical truth (no dual truth with generated files).
  • No hidden worktree coupling introduced in core/domain/materialization paths.
  • Context-sensitive behavior is explicit (--at, --observer, --trust) or deterministically defaulted.
  • Resolved context is surfaced in output metadata where applicable.

Determinism & Provenance

  • Pure query/materialization paths remain deterministic for identical inputs.
  • Mutations/materializations include provenance receipts/envelopes where required.
  • Cache keys (if used) are derived only from semantic inputs + pinned versions.

Artifact Hygiene

  • No forbidden generated artifact paths are tracked.
  • Any generated artifacts intentionally tracked are in allowlisted publish paths only.
  • Pre-commit/CI policy checks updated or confirmed valid.

Contracts & Compatibility

  • Machine-facing outputs are schema-versioned.
  • Breaking contract changes include version bump + migration notes.
  • Backward compatibility impact is documented below.

Extension/Effects Safety (if applicable)

  • Extension behavior does not bypass capability restrictions.
  • Effectful operations use explicit plan/apply semantics and emit receipts.
  • Timeouts/resource bounds are defined for new script/effect paths.

Scope Control

  • PR is single-purpose/cohesive (no unrelated refactors).
  • Any non-essential refactor is split into separate PR(s) or explicitly justified.

Backward Compatibility

  • CLI/API contract changes: None.
  • Data model/storage changes: None.
  • Migration required?: No.
  • User-facing behavior changes: Canonical docs and backlog framing now point directly at the first executable Hill 1 semantic bootstrap slice.

Test Plan (Required)

Unit

  • Added/updated tests for changed logic
  • Commands:
# Docs/spec PR; no unit test changes.

Integration

  • Added/updated integration tests
  • Commands:
# Docs/spec PR; no integration test changes.

Determinism

  • Determinism assertions included for relevant paths
  • Method:
  • Commands:
# Not applicable for this docs/spec change.

Contract/Schema

  • Schema validation updated/passing
  • Commands:
# No schema changes.

Policy Gates

  • Mechanical architecture gates pass
  • Commands:
git commit

Security / Trust Impact

  • Threat surface changed?: No runtime threat-model change.
  • Trust policy impact: None.
  • Provenance/audit impact: Planning and execution are now tied to an explicit first-slice Hill 1 spec.
  • New failure modes introduced: None in runtime behavior.

Performance Impact

  • Hot path affected?: No.
  • Expected impact (latency/memory/io): None.
  • Benchmarks or profiling evidence: Not applicable.

Observability / Debuggability

  • Errors are actionable and include context.
  • Logs/diagnostics added or updated where needed.
  • git mind status / diagnostics updated if writeback/eventing behavior changed.

Operational Notes

  • Feature flag (if any): None.
  • Rollback strategy: Revert this docs/spec commit if the Hill 1 framing needs revision.
  • Operational caveats: This PR is docs/spec only. The full npm test suite continues to exhibit pre-existing timeout flake under full load, so I did not use it as the primary validation signal for this change.

Linked Issues / Milestones


Reviewer Quick Verdict Block (for maintainers)

MUST (Hard Gates)

  • PASS

SHOULD (Quality)

  • PASS

Verdict

  • APPROVE

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

Summary by CodeRabbit

  • Documentation

    • Updated roadmap to clarify current focus on "Hill 1 Semantic Bootstrap" with specific deliverables and exit criteria.
    • Added new specification document defining the first executable Hill 1 slice, including command contract, entity types, relationship inference, confidence levels, and output requirements.
  • Chores

    • Extended schema and validators to support new entity and relationship types for semantic bootstrapping.

Walkthrough

Documentation and schema updates establish "Hill 1 Semantic Bootstrap" as the explicit current focus, add a new Hill 1 design spec and docs index entry, and extend the canonical graph schema and runtime validators with a pr node prefix plus three new edge types (references, touches, groups). Tests were updated accordingly.

Changes

Cohort / File(s) Summary
Roadmap Clarification
ROADMAP.md
Replaced generic "Stabilize And Clarify" with explicit "Hill 1 Semantic Bootstrap"; rewrote sponsor/user, goals, deliverables, exit criteria, updated hill map labels and suggested artifact set.
Documentation Index
docs/README.md
Added link entry for the new "Hill 1 Semantic Bootstrap Spec" (docs/design/h1-semantic-bootstrap.md).
New Hill 1 Spec
docs/design/h1-semantic-bootstrap.md
Added draft spec defining scope (repo-local inputs), v0 entity types, v0 relationship types, provenance schema, simple confidence model, git mind bootstrap CLI contract/outputs, staged implementation slices, day-one questions, and exit criteria.
Graph Schema
GRAPH_SCHEMA.md
Added pr project-management prefix; added system prefixes repo and epoch; added edge types references, touches, groups; updated canonical arrays and appendix.
Runtime Validators
src/validators.js
Updated validator constants: added canonical prefix 'pr' and edge types 'references', 'touches', 'groups' to exported arrays used for validation.
Tests
test/edges.test.js, test/validators.test.js
Updated test expectations to include the three new edge types and the new 'pr' canonical prefix; adjusted expected counts accordingly.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🏔️ Hill 1 etched in roadmap light,
A spec, a bootstrap — CLI in sight.
Prefixes added, edges three fold,
Tests updated, the schema told.
Small map born; provenance in gold.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title 'docs: define Hill 1 semantic bootstrap slice' directly and specifically summarizes the primary change—adding the concrete Hill 1 bootstrap spec and reframing the roadmap.
Description check ✅ Passed PR description is comprehensive, follows the template structure, provides all critical sections (summary, problem statement, ADR compliance, architecture laws, scope, backward compatibility, test plan, security/trust, operational notes, linked issues), and thoroughly documents decisions and trade-offs.
Linked Issues check ✅ Passed Code changes fully satisfy issue #303 requirements: concrete first-slice spec is delivered (h1-semantic-bootstrap.md), artifact set defined, entity/relationship types specified, provenance and confidence models documented, bootstrap command contract defined, output requirements and exit criteria established, and roadmap visibly reframed to reflect Hill 1 priorities.
Out of Scope Changes check ✅ Passed All changes are tightly scoped to documentation and schema declarations supporting Hill 1 semantic bootstrap definition. No extraneous refactoring, unrelated feature work, or scope creep detected—only spec, roadmap clarification, and validator/test alignment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 feat/h1-bootstrap-spec

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@docs/design/h1-semantic-bootstrap.md`:
- Line 83: Update the docs line that currently reads "`doc:` for general
markdown documents" to use the proper noun capitalization — change "markdown" to
"Markdown" so it reads "`doc:` for general Markdown documents"; ensure any other
occurrences in the same file follow this "Markdown" capitalization for
consistency.
- Around line 171-177: The doc currently presents the command literal "git mind
bootstrap" as if available; update the text around the suggested command shape
(the "git mind bootstrap" example) to add a clear one-line status note such as
"Status: planned contract for Hill 1 — this command is not implemented in the
current CLI yet" so readers won't assume it's shipped; place this note
immediately after the code block where "git mind bootstrap" appears and keep the
phrasing concise and unambiguous.

In `@ROADMAP.md`:
- Around line 92-123: Update the roadmap diagram label that currently reads
"Stabilize And Clarify" to match the section heading "Current Focus: Hill 1
Semantic Bootstrap" so the document is self-consistent; locate the diagram/label
text in the ROADMAP.md content and replace that label string with "Hill 1
Semantic Bootstrap" (or equivalent phrasing used in the section header) ensuring
any alt text/captions are updated too.
🪄 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

Run ID: d36aa2d4-0688-4b7d-9fa2-f2827fe3279d

📥 Commits

Reviewing files that changed from the base of the PR and between bb4946f and 248c33d.

📒 Files selected for processing (3)
  • ROADMAP.md
  • docs/README.md
  • docs/design/h1-semantic-bootstrap.md

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ROADMAP.md`:
- Around line 92-123: Update the "Current Focus: Hill 1 Semantic Bootstrap"
block to explicitly name the sponsor user and the job-to-be-done (JTBD): add two
short fields such as "Sponsor user: <role/persona>" and "Job-to-be-done:
<concise JTBD statement>" within that section so the focus is auditable against
the operating model; edit the "Current Focus: Hill 1 Semantic Bootstrap" header
area (the block containing Status, Goal, Deliverables, Exit criteria, Primary
references) to include those two lines and ensure wording ties to the Hill
(e.g., sponsor = unfamiliar-repo maintainer or developer persona, JTBD =
"quickly understand repository structure and key entities with minimal input")
so reviewers can verify alignment.
🪄 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

Run ID: aff9c761-40f8-48e5-a4dd-fb0413a0215a

📥 Commits

Reviewing files that changed from the base of the PR and between 248c33d and 873fbab.

📒 Files selected for processing (1)
  • ROADMAP.md

@flyingrobots
Copy link
Owner Author

@coderabbitai review please 🥕

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

@flyingrobots Sure, kicking off the review now — no carrot left unexamined. 🐇🥕

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@GRAPH_SCHEMA.md`:
- Line 360: The taxonomy and appendix are inconsistent: the constant
SYSTEM_PREFIXES lists ['commit','repo','epoch'] but Section 3’s system-generated
table documents only commit:, so unify the contract by making the authoritative
taxonomy match the appendix (or vice versa). Update the declaration referencing
SYSTEM_PREFIXES to reflect the single canonical set of system prefixes used in
Section 3 (e.g., remove or add 'repo' and 'epoch' to match the documented
table), and ensure any prose in Section 3 or the appendix is edited to state the
exact same prefixes and format (including colon suffix like "commit:") so
SYSTEM_PREFIXES and the Section 3 table are identical.
- Around line 152-153: Update the stale cardinality wording mentioning "8 valid
edge types" to reflect the current contract of eleven types (e.g., replace the
literal "8 valid edge types" with "11 valid edge types" and scan the document
for any other occurrences of the old cardinality phrase); ensure the non-example
descriptions and any text that contrasts with "Eleven directed edge types are
defined" are consistent with the updated count.
🪄 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

Run ID: 1282c768-afe9-462a-bdf0-f871b3bd074e

📥 Commits

Reviewing files that changed from the base of the PR and between 873fbab and 5fcb6ad.

📒 Files selected for processing (6)
  • GRAPH_SCHEMA.md
  • ROADMAP.md
  • docs/design/h1-semantic-bootstrap.md
  • src/validators.js
  • test/edges.test.js
  • test/validators.test.js

@flyingrobots
Copy link
Owner Author

@coderabbitai review please 🥕

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

@flyingrobots One carrot received, review incoming — no spec detail escapes scrutiny. 🥕🔍

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@flyingrobots
Copy link
Owner Author

@coderabbitai review please 🥕

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

@flyingrobots Triple-carrot dedication noted — the bar for thoroughness has been raised accordingly. 🐇🥕🥕🥕 Triggering a full review now — every schema constant, every spec clause, every exit criterion will be cross-examined with extreme prejudice.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
GRAPH_SCHEMA.md (2)

82-86: 🧹 Nitpick | 🔵 Trivial

Semantic overload: repo: is both a "system prefix" and a cross-repo namespace qualifier.

The spec lists repo: in the System-Generated (Reserved) prefix table (line 142) alongside commit: and epoch:, which are actual node prefixes. But repo: is NOT a node prefix—it's a namespace qualifier for cross-repo IDs.

Confusion:

  • Line 82: "repo: prefix is a system prefix"
  • Line 83: "returns the inner prefix (e.g., crate for repo:owner/name:crate:id)"
  • So for repo:foo/bar:task:123, the actual prefix is task:, not repo:

Impact:

  • Readers see repo: in the system prefix list and assume it works like commit: or epoch:
  • But you cannot have a node repo:123 — that's invalid syntax
  • The SYSTEM_PREFIXES array mixes namespace qualifiers with actual prefixes

Consider one of these fixes:

Option 1: Move repo: to a separate section "Reserved Namespaces" instead of listing it as a prefix:

### Reserved Namespaces
| Namespace | Purpose | Example |
|-----------|---------|---------|
| `repo:` | Cross-repo ID qualifier | `repo:owner/name:crate:id` |

Option 2: Add a clarifying note in the system prefix table:

| `repo:` | Cross-repo qualifier namespace (not a node prefix) | `repo:owner/name:crate:echo-core` |

Option 3: Keep as-is but add explicit prose: "Note: Unlike commit: and epoch:, repo: is not a node prefix—it's a namespace qualifier that wraps other node IDs."

Also applies to: 142-143

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GRAPH_SCHEMA.md` around lines 82 - 86, The doc incorrectly treats `repo:` as
a node prefix; update the schema so `repo:` is documented as a cross-repo
namespace qualifier rather than a system node prefix: change the SYSTEM_PREFIXES
listing (or the System-Generated (Reserved) table) to remove or annotate `repo:`
and add a separate "Reserved Namespaces" entry for `repo:` (or a clarifying
note) showing examples like `repo:owner/name:crate:id`, and adjust the prose
around extractPrefix to state that extractPrefix returns the inner node prefix
(e.g., `crate` for `repo:owner/name:crate:id`) so readers understand `repo:`
wraps, not replaces, actual prefixes.

83-83: 🛠️ Refactor suggestion | 🟠 Major

Implementation leakage: Spec references undefined extractPrefix function.

Line 83 states "extractPrefix returns the inner prefix" but never defines what extractPrefix is, where it exists, or its signature. This is an implementation detail leaking into what should be an implementation-agnostic contract specification.

Impact:

  • Readers must guess that extractPrefix is a function in the codebase
  • The spec fails to define the behavior independently
  • Violates the stated principle that this is the "authoritative contract" (line 3) that implementations build against

Rewrite line 83 to define the behavior without referencing implementation:

-- `extractPrefix` returns the **inner** prefix (e.g., `crate` for `repo:owner/name:crate:id`)
+- The prefix of a cross-repo ID is the **inner** prefix (e.g., `crate` for `repo:owner/name:crate:id`)

Or add a definition:

**Term: extractPrefix(nodeId)** — Returns the prefix portion of a node ID. For cross-repo IDs, returns the inner prefix after the `repo:owner/name:` qualifier.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GRAPH_SCHEMA.md` at line 83, Replace the implementation-leaning sentence
mentioning "extractPrefix" with an implementation-agnostic term definition that
specifies the behavior: define "extractPrefix(nodeId)" (or a "prefix" term) as
"the prefix portion of a node ID; for cross-repo IDs the inner prefix is the
segment after the 'repo:owner/name:' qualifier (e.g., 'crate' for
'repo:owner/name:crate:id')", so the spec stands alone without assuming a
concrete function exists; reference the term "nodeId" and show the cross-repo
example to clarify expected parsing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@GRAPH_SCHEMA.md`:
- Around line 165-168: Add a short "Directionality note" to Section 4 clarifying
that `groups` and `belongs-to` are inverse containment relationships and specify
a convention: use `belongs-to` for manually authored child→parent edges and
reserve `groups` for system-generated parent→child containment edges (or
explicitly state deprecation of one if preferred); reference the symbols
`groups` and `belongs-to` and update any examples in the schema to reflect the
convention so authors and queries have a single canonical direction to rely on.
- Line 143: The description of the `epoch:` prefix is too vague—update the
GRAPH_SCHEMA.md entry for `epoch:` to provide concrete semantics: define
"time-travel" as immutable, monotonic version checkpoints (snapshots) distinct
from `commit:` (where `commit:` denotes a specific change/merge event and
`epoch:` denotes broader snapshot boundaries), state when epoch nodes are
created (e.g., on snapshot, release, or compaction events), explain what they
represent (read-only snapshot ID, wall-clock and logical timestamp, and optional
metadata), and give example lifecycle rules for epoch/timeline machinery (how
epochs relate to commits, retention, and lookup). Also expand the
"epoch/timeline machinery" section to list responsibilities (create/retire
epochs, map commits to epochs, query semantics for time-travel reads) and
provide an example showing `epoch:` vs `commit:` usage and canonical formats
(hash + timestamp).
- Around line 145-150: The docs claim system prefixes (commit:, repo:, epoch:)
are rejected but the code only classifies them; update src/validators.js to
enforce this: in the import/node validation path (where classifyPrefix() and the
edge validation run) detect prefixes that match SYSTEM_PREFIXES and throw/reject
with a clear error (use classifyPrefix() to identify system prefixes), ensuring
user-authored import nodes and edges containing commit:, repo:, or epoch:
produce a hard error; add unit tests for the import validation path that assert
rejection and update any warning-only branches to raise errors instead of
silently accepting these prefixes.

---

Outside diff comments:
In `@GRAPH_SCHEMA.md`:
- Around line 82-86: The doc incorrectly treats `repo:` as a node prefix; update
the schema so `repo:` is documented as a cross-repo namespace qualifier rather
than a system node prefix: change the SYSTEM_PREFIXES listing (or the
System-Generated (Reserved) table) to remove or annotate `repo:` and add a
separate "Reserved Namespaces" entry for `repo:` (or a clarifying note) showing
examples like `repo:owner/name:crate:id`, and adjust the prose around
extractPrefix to state that extractPrefix returns the inner node prefix (e.g.,
`crate` for `repo:owner/name:crate:id`) so readers understand `repo:` wraps, not
replaces, actual prefixes.
- Line 83: Replace the implementation-leaning sentence mentioning
"extractPrefix" with an implementation-agnostic term definition that specifies
the behavior: define "extractPrefix(nodeId)" (or a "prefix" term) as "the prefix
portion of a node ID; for cross-repo IDs the inner prefix is the segment after
the 'repo:owner/name:' qualifier (e.g., 'crate' for
'repo:owner/name:crate:id')", so the spec stands alone without assuming a
concrete function exists; reference the term "nodeId" and show the cross-repo
example to clarify expected parsing behavior.
🪄 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

Run ID: b35c8392-b1c8-40ac-bd59-d358dfe0cb16

📥 Commits

Reviewing files that changed from the base of the PR and between 5fcb6ad and 903ca3e.

📒 Files selected for processing (1)
  • GRAPH_SCHEMA.md

|--------|---------|---------|
| `commit:` | Git commit (auto-generated by hooks) | `commit:934b6e3` |
| `repo:` | Cross-repo qualifier namespace for remote node IDs | `repo:owner/name:crate:echo-core` |
| `epoch:` | System-generated temporal/version marker for time-travel | `epoch:934b6e3` |
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Vague description: epoch: "time-travel" semantics are undefined.

Line 143 describes epoch: as a "System-generated temporal/version marker for time-travel" but never defines:

  • What "time-travel" means in this context
  • How epoch: differs from commit: (both examples use hash-like identifiers)
  • When epoch nodes are created
  • What they represent (snapshots? checkpoints? version boundaries?)

The phrase "epoch/timeline machinery" (line 149) is equally opaque.

Impact:

  • Readers cannot understand the purpose or semantics of epoch nodes
  • Implementers have no guidance on when to create epoch: nodes
  • The spec fails to define this reserved prefix clearly

Expand the description with concrete semantics:

-| `epoch:` | System-generated temporal/version marker for time-travel | `epoch:934b6e3` |
+| `epoch:` | System-generated snapshot marker for graph state at a point in time | `epoch:2026Q1-release` |

And expand line 149:

-- `epoch:` nodes are created automatically by the epoch/timeline machinery and are not authored directly in import files.
+- `epoch:` nodes are created automatically when capturing graph snapshots (e.g., for versioning, rollback, or historical queries) and are not authored directly in import files.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GRAPH_SCHEMA.md` at line 143, The description of the `epoch:` prefix is too
vague—update the GRAPH_SCHEMA.md entry for `epoch:` to provide concrete
semantics: define "time-travel" as immutable, monotonic version checkpoints
(snapshots) distinct from `commit:` (where `commit:` denotes a specific
change/merge event and `epoch:` denotes broader snapshot boundaries), state when
epoch nodes are created (e.g., on snapshot, release, or compaction events),
explain what they represent (read-only snapshot ID, wall-clock and logical
timestamp, and optional metadata), and give example lifecycle rules for
epoch/timeline machinery (how epochs relate to commits, retention, and lookup).
Also expand the "epoch/timeline machinery" section to list responsibilities
(create/retire epochs, map commits to epochs, query semantics for time-travel
reads) and provide an example showing `epoch:` vs `commit:` usage and canonical
formats (hash + timestamp).

Comment on lines 145 to 150
**System prefix rules:**
- `commit:` nodes are created automatically by the post-commit hook.
- User-provided `commit:` nodes in import files are **rejected** (hard error).
- `repo:` is reserved for system-managed cross-repo qualification and should not be introduced ad hoc in import files.
- `epoch:` nodes are created automatically by the epoch/timeline machinery and are not authored directly in import files.
- Future system prefixes will use the `sys-` namespace (e.g., `sys-audit:`).
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how system prefixes are enforced in import logic

echo "=== Search for commit: validation/rejection logic ==="
rg -n "commit:" src/import.js src/validators.js -B2 -A2

echo -e "\n=== Search for system prefix enforcement ==="
rg -n "SYSTEM_PREFIXES|system.*prefix|classifyPrefix" src/ -B2 -A2 | head -50

echo -e "\n=== Search for hard error conditions ==="
rg -n "hard error|reject.*prefix|system.*reject" src/ -B1 -A1

Repository: flyingrobots/git-mind

Length of output: 2539


Documentation falsely promises system prefix enforcement that doesn't exist in code.

Lines 147-149 claim system prefixes are controlled:

  • commit: nodes are "rejected (hard error)"
  • repo: "should not be introduced ad hoc"
  • epoch: "are not authored directly"

None of this is enforced. The code has zero runtime protection against any of these prefixes appearing in user-authored nodes.

Evidence from src/validators.js:

  • classifyPrefix() (lines 93-96) is a read-only classifier, not an enforcer—it returns classification strings but takes no action
  • Edge validation (lines 186-196) only warns about unknown prefixes; system prefixes are silently accepted
  • The SYSTEM_PREFIXES array (line 27) documents what exists, but no code rejects or errors on them

Result: Users CAN currently create commit:, repo:, and epoch: nodes in import files without any error, warning, or rejection, directly contradicting what the spec promises.

Required: Either enforce the restrictions with actual rejection logic, or remove the false claims from the documentation. Claiming "hard error" and "rejected" while the code accepts them is a contract violation.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GRAPH_SCHEMA.md` around lines 145 - 150, The docs claim system prefixes
(commit:, repo:, epoch:) are rejected but the code only classifies them; update
src/validators.js to enforce this: in the import/node validation path (where
classifyPrefix() and the edge validation run) detect prefixes that match
SYSTEM_PREFIXES and throw/reject with a clear error (use classifyPrefix() to
identify system prefixes), ensuring user-authored import nodes and edges
containing commit:, repo:, or epoch: produce a hard error; add unit tests for
the import validation path that assert rejection and update any warning-only
branches to raise errors instead of silently accepting these prefixes.

Comment on lines +165 to 168
| `groups` | Source groups or contains target | parent → child | `module:auth → file:src/auth.js` |
| `blocks` | Source blocks progress on target | blocker → blocked | `task:BDK-001 → task:BDK-002` |
| `belongs-to` | Source is a child/member of target | child → parent | `feature:BDK-SCHEMA → milestone:BEDROCK` |
| `consumed-by` | Source is consumed/used by target | resource → consumer | `pkg:chalk → module:format` |
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Semantic overlap: groups and belongs-to are inverse relationships with no disambiguation guidance.

Line 165 defines groups as "Source groups or contains target" (parent → child), while line 167 defines belongs-to as "Source is a child/member of target" (child → parent). These are semantic inverses of the same relationship.

Impact:

  • Users must choose between module:auth --groups--> file:src/auth.js and file:src/auth.js --belongs-to--> module:auth
  • The spec provides zero guidance on which direction to prefer
  • Graph queries will need to check both directions to find containment relationships
  • Inconsistent usage across the codebase will fragment the knowledge graph

Add a guidance note to Section 4 clarifying when to use each direction, or consider deprecating one in favor of the other. For example:

**Directionality note:** `groups` and `belongs-to` are inverse relationships. By convention, use `belongs-to` when authoring manual edges (child → parent), and reserve `groups` for system-generated containment edges (parent → child).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GRAPH_SCHEMA.md` around lines 165 - 168, Add a short "Directionality note" to
Section 4 clarifying that `groups` and `belongs-to` are inverse containment
relationships and specify a convention: use `belongs-to` for manually authored
child→parent edges and reserve `groups` for system-generated parent→child
containment edges (or explicitly state deprecation of one if preferred);
reference the symbols `groups` and `belongs-to` and update any examples in the
schema to reflect the convention so authors and queries have a single canonical
direction to rely on.

@flyingrobots flyingrobots merged commit 8bc192e into main Mar 25, 2026
8 checks passed
@flyingrobots flyingrobots deleted the feat/h1-bootstrap-spec branch March 25, 2026 12:51
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.

bootstrap: define first semantic bootstrap slice for unfamiliar repositories

1 participant