Skip to content

sdg: initial build — xspec#1

Open
lzrscg wants to merge 81 commits into
mainfrom
sdg/initial-build
Open

sdg: initial build — xspec#1
lzrscg wants to merge 81 commits into
mainfrom
sdg/initial-build

Conversation

@lzrscg

@lzrscg lzrscg commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

SDG initial-build PR for xspec, a requirement-traceability tool for specifications written in MDX.

Phase 2 (triage & draft): seed classified as the initial build (no prior specs/SPEC.md); the Developer-authored seed specification is adopted as the initial specs/SPEC.md draft. specs/GOALS.md follows after explicit Developer approval, and specs/tmp/SEED.md is deleted once consumed. Subsequent phases (SPEC refinement, TEST-SPEC, certifications, scaffolding, harness and product implementation) continue on this branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ


Generated by Claude Code

claude added 16 commits July 9, 2026 00:35
…; record seed-style principle in PHILOSOPHY.md
Triage classification: initial build (no prior specs/SPEC.md).
Seed adopted verbatim as the SPEC.md draft with Markdown structure
restored; single-file (no modules) — components share a dense core
and the Developer authored the seed as one coherent document.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
GOALS.md approved verbatim by Developer via Liaison. SEED.md deleted
(consumed by triage). Phase 2 complete; next: Phase 4 refinement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applied: C1-C6, I1-I17, O1-O4, O6-O8.
- C1: layer diagram removed (prescribed internal architecture, untestable).
- C2/I8a: config example disambiguated (boundaryKind, selector kind); group
  selectors gain a kind disambiguator mirroring boundaryKind.
- C3: canonical identity defined as journal-origin identity, so stored hashes
  are rename/move-invariant; forced by 6.2 + 10.4 + the GOALS durable-identity
  bullet. Reintroduced identities stay hash-distinct; baseline hashing uses the
  baseline journal; non-prefix journals fail the command.
- C4: code-location identity syntax, named-code-unit rule, nesting, and
  document-order collision suffix defined in 4.6.
- C5: upstream-changed propagates through subtrees (matches §15);
  parent-consistency items exclude the root; dependency-consistency items only
  for nodes with a directly changed dependency target; §15 made exact.
- C6: split now emits a parent-consistency item for the scope root's own text,
  with defined blocking, removal of the original, and refusal cases.
- I1 also covered the identical dangling ref in 1.4 ((3.8) -> (2.6)).
- I2-I17: '#' banned in segments/paths with '/' as canonical separator; error
  conditions 15-19 added (imports, constructs, props, node usage, source
  paths); TS reference forms pinned; content-based staleness; ignored-node
  definition; session-name syntax; review command edge cases; re-derivation
  mechanics; read-command graph refresh; move edge cases; derived-path
  ownership and source exclusion; lookup exit codes; baseline edge cases.
Rejected: O5 (extract §10 into a module) - reviewer itself deems a single file
defensible at current size, and PROCESS module rules keep the full review
interface (commands, statuses, item kinds) in SPEC.md regardless, leaving
little to extract.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applied: C1, C2, I1-I15, O1-O6, O8, O9.

- C1: partitioned exit codes — configuration errors are load-time usage
  errors (exit 2) for every command per GOALS; nonexistent rename/move
  origins and unknown review item IDs are usage errors; refusals stay
  exit 1; 14.14 recast, 12.2 config clause relocated.
- C2/I1/I2: hash property sentences corrected; metadataHash pinned to
  d-declared targets; upstream-changed covers dependency-set changes;
  attribution redefined to originating (changed or metadata-changed)
  nodes with a metadata-edit worked example.
- I3/I4: resolved/blocked defined, invalidated items re-enter via next
  and re-block dependents; total item order specified for path-blocks
  and coverage sessions.
- I5/I6/I7: import specifier resolution and permitted forms defined
  (MDX and TS); MDX comments carved out and stripped; spec-group files
  must be .mdx (14.19).
- I8: byte-exact Markdown emission (in-place deletion, emptied lines
  dropped with terminators).
- I9: derived-file paths recorded in graph data; build removes orphans,
  check reports them (14.10), refresh preserves the record.
- I10: mutating commands mutually exclusive per workspace; second
  fails with usage error; interrupted mutations detected by check.
- I11: identity syntaxes per command (root bare path, code locations
  for query edges/reachable, show).
- I12: arrow-function initializers are named code units.
- I13: config key optionality and defaults pinned (specs required;
  markdown absent = no emission; emit and mode required).
- I14: new 14.20 unparseable source; read commands fail with build
  validation errors on invalid sources.
- I15: 13.1 restated behaviorally (module + companion files satisfying
  4.1-4.5); declaration-map mechanism dropped from 4.2; source
  exclusion by .xspec. filename rule.
- O1-O6, O8, O9: clarifications as suggested.

Rejected:
- O7: pinning a specific hover-truncation number is arbitrary
  pseudo-precision bordering on an implementation detail; the existing
  deterministic-limit requirement plus staleness checking (14.10)
  already fully pins generated content.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applied all items: C1-C4, I1-I9, O1-O8.
- C1: subtree/own text defined positionally via Markdown-compilation
  contribution (interleaved, byte-exact); ownHash made run-aware so the
  subtreeHash iff-property holds under interleaving.
- C2: cross-module text call (14.11) now reported by build/check per the
  preamble default; 4.5/14.18 carved to keep conditions 11 and 18 disjoint.
- C3: 14.10 marked check-only.
- C4: invalidation anchored to state recorded at resolution, with explicit
  absent markers, so deletion review stays resolvable.
- I1: rename/move regenerate derived files as build does.
- I2: journal added to derived-file reproducibility inputs.
- I3: doc-comment limit pinned (1000 code points, ellipsis) and */ escaping.
- I4: audit strategy pinned (roots included, 10.5 scope, child-item blockedBy).
- I5: resolve-time re-derivation generalized to all strategies.
- I6: review next with nothing to review defined (exit 0, both cases named).
- I7: --test-hold seam for deterministic mutual-exclusion testing.
- I8: duplicate import bindings under 14.15; TS string-form text() under 14.8.
- I9: deleted nodes reported under journal-mapped-forward baseline identity.
- O1-O8: placement explicit, example labels moved outside fences,
  self-rename refused, root metadata/coverage reporting pinned, dynamic
  .xspec import invalid, review create modes exclusive, list/status/show
  content lists, read-time invalidation never persisted.

Rejected: none.
Applied: C1, C2, I1-I18, O1-O6, O8.

- C1: made hash constructions satisfy the stated iff properties by
  folding canonical identities into the inputs — child identities enter
  ownHash at their excision points (so structural edits are the
  parent's edit, keeping GOALS attribution sound), dependency targets
  enter effectiveHash as (identity, hash) pairs. Rename/move invariance
  preserved via canonical identities. 5.4/5.5/5.6/6.2 aligned.
- C2: split decompositions are recorded session state; defined the
  (kind, scope-node) uniqueness invariant, match/reuse at split and
  re-derivation, recursive decomposition replacement, and blockedBy
  recomputation (retained items keep theirs).
- I1: policy violations are check-only findings; build regenerates
  regardless (7.5, 12.1, 14.12).
- I2: reads evaluate context sets by running generators unpersisted.
- I3: id/coverage/tags must be static string literals (2.7, 14.17).
- I4: explicit N+1 own-text runs incl. empties (1.6).
- I5: absent journal = empty journal, current and at baseline.
- I6: rename and file-form move are pure; section-form move
  restructures both parents (changed + cascades).
- I7: impacted code evaluated over union of baseline+current
  references/embeds edges; added/deleted count as changed.
- I8: empty targetTags and empty selector tags are config errors.
- I9: whole-pattern leftmost-shortest disambiguation for wildcards
  and captures.
- I10: context/origin/blockedBy defined for all item kinds, incl.
  coverage and split-created items; blockedBy empty by default.
- I11: audit order = file path bytes, then document order; blocking
  enforces bottom-up.
- I12: node/file/glob args are workspace-relative; --config and
  --test-hold resolve against cwd.
- I13: rename/move refuse up front on a workspace failing build
  validation.
- I14: create refuses names matching an existing session
  case-insensitively.
- I15: corrupt review session defined (14.21); review subcommands
  exit 1 on it.
- I16: query subtree/ancestors membership+rows defined; reachable
  --kinds default stated.
- I17: markdown.outDir must resolve within the workspace root.
- I18: parent-consistency blockedBy defined per changed branch;
  only subtree-coherence/parent-consistency block it.
- O1 global byte-wise comparison; O2 length-one cycles; O3 exclusivity
  ends with holder process; O4 orphan-removal claim qualified;
  O5 --test-hold creation failure; O6 flag syntax; O8 UTF-8/no-BOM.

Rejected: O7 (extract §10 into a module only if the file grows —
condition not met; Reviewer itself deems current size acceptable, and
§10 is tightly coupled to the hash and CLI contracts).
Applied:
- C1: separated expanded text values from pre-expansion "own content"
  (1.6); ownHash and the subtreeHash iff now defined over own content
  (5.5); all own/subtree text outputs (4.2, 10, 11, 12.4) pinned to the
  expanded value.
- C2: whitespace and control characters defined by exact code points in
  1.4; referenced from 2.6 tag splitting and 3 line dropping.
- C3: review create records fully resolved creation parameters (baseline
  commit; coverage profile snapshot with group globs/kinds); generator
  runs use recorded parameters (10.1, 10.4, 10.5, 10.7); unreadable
  recorded baseline fails per 6.3 as usage error.
- I1: imports in xspec source files may not bind S, Spec, or text
  (2.1, 14.15).
- I2: id/coverage/tags values must be quoted-form string literals;
  braced expressions invalid (2.7, 14.17).
- I3: non-conforming files under .xspec/reviews/ are not sessions and
  are ignored; review list reports corrupt sessions and exits 1
  (10.1, 10.7, 12.0, 14.21).
- I4: failed build/refresh modifies nothing - derived files and graph
  data unchanged (12.1, 13.3).
- I5: review export payload defined - JSON-only full session dump with
  invalidation applied (10.7).
- I6: code-group imports designating derived-file paths outside the
  .xspec specifier are invalid (4, 14.15).
- O2: worked change-category example for pure structural add/remove
  (5.6).
- O3: next on a zero-item session reports the every-item-resolved case
  (10.7).
- O4: session corruption invariants enumerated (10.1).
- O5: build/check report all detectable errors; parse-failure masking
  defined (14 preamble).
- O6: "collapsed" ancestor chains defined for impact output (9.3).

Rejected:
- O1 (modularize section 10): review commands, invalidation, and
  strategy re-derivation are tightly interwoven; a split at the current
  file size risks restating the interface in the module or referencing
  module internals from SPEC.md. Reviewer itself deemed deferral
  reasonable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…d reference-chain grammar in SPEC.md

Applied: C1, I1, I2, I3, O1, O3, O4, O5, O6
- C1: repeated props on <S>/<Spec> are invalid (2.7, 14.17)
- I1: line terminator set (CRLF as one, lone LF, lone CR) and
  unterminated final line defined for the line-drop rule (3)
- I2: d value pinned to braced expression holding a single static
  reference or array literal; quoted/valueless d is 14.17, non-reference
  braced value is 14.8 (2.2, 2.7, 14.17)
- I3: static-chain grammar pinned (.name / ["literal"] segments only;
  optional chaining, non-null assertions, parentheses, other indices
  dynamic), text(...) arity pinned to one argument, non-chain expression
  statements in TS classified 14.18 (1.4, 2.4, 4.5, 14.8)
- O1: 13.5 atomicity restated as the observable contract (readers never
  see partial content)
- O3: repeated flags are a usage error; list-valued flags take one
  comma-separated value (12.0)
- O4: ids --tree/--file semantics defined; --file is a glob as in 11 (12.3)
- O5: companion files named NAME.xspec.<suffix>, keeping them under the
  derived-file exclusion (13.1)
- O6: missing parent id masks structural-ID checks for immediate
  children only (14.2)

Rejected: O2 — pinning MDX/TypeScript grammar editions is a
product-scoping choice not derivable from the bundle; the spec's own
construct grammar (2.1-2.7, 2.4) is pinned independently of edition and
14.20 remains the residual parse-failure class.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applied all items; none rejected.

- C1: 6.2 section-form move claim made conditional on own-content change;
  coinciding-parent degenerate case acknowledged as pure in effect.
- C2: 15 example graph gains the two root contains edges.
- I1: 5.4 canonical identity redefined as a journal walk whose termination
  (an entry vacating the tracked identity) plus end position distinguishes
  reintroduced identities by construction.
- I2: 9.3 propagation path defined (contains/dependency steps to the
  explaining edit; subtreeHash chain for direct, effectiveHash for transitive).
- I3: 7 + 14.14 unknown configuration keys are a configuration error.
- I4: 10.7 guarantee scoped to recorded parameters; discovery follows current
  configuration, de-grouped files leave the session's view like deletions.
- I5: coverage named as the third built-in strategy (10, 10.5, 10.7).
- I6: 6.5 section-form text semantics pinned (exact deletion + line drop at
  origin; insertion before the target parent's closing tag with terminator
  rules; no other byte changes).
- O1: 12.0 missing required flags/arguments classified as usage errors.
- O2: query edges takes --kinds (comma list) aligning with reachable.
- O3: 7 empty groups and group-less specs/code maps are valid.
- O4: 7.4/14.14 wrong-kind group references are configuration errors.
- O5: 12.0 shortest-path tie-break (element-wise byte-least identity
  sequence); 8.2 reports one shortest covering path.
- O6: 6.4 rewritten references preserve quote/access form; fresh forms pinned.

Also absorbs the prior interrupted round's uncommitted 4.5/6.5 edits, which
this review upholds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applied:
- C1: section-form move now refuses (exit 1) when the target parent
  section is missing or lies within the moved subtree (6.5).
- I1: discovery never follows symbolic links (7); the only rule
  coherent with baseline reconstruction from git content (6.3).
- I2: impact output pins edge+path selection — minimized over all
  qualifying impact edges, 12.0 tie-break, byte-least kind (9.3).
- I3: code-impact context pinned to impact-edge targets whose
  subtreeHash or effectiveHash changed (10.5 item 3).
- O1: reference rooting is scope-aware; shadowed bindings are not
  spec references (4.5).
- O2: type-level TypeScript references are not rewritten by
  rename/move (6.4).
- O3: each changed branch enters parent-consistency context as one
  node, A's child on the branch (10.5); 10.4 aligned to context node.
- O4: graph-data content declared opaque with its observable
  contract (13.3).

Rejected: none.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applied:
- C1: total item order for absent scope nodes — present-first at the
  document-order key, absent ordered by forward-mapped identity then
  item id; covers 10.5, 10.6, and 10.7 orders.
- C2: item/decomposition/invariant matching and invalidation compare
  requirement nodes as canonical identities (5.4), never spellings;
  reads present recorded nodes under forward-mapped current identity.
- I1: 12.0 pins output streams — reports (findings included) on
  stdout, exit-2 errors and diagnostics on stderr; --json document is
  the entire stdout.
- I2: xspec.config.ts pinned as declarative static data (exact form
  defined in 7); non-conforming config is a configuration error
  (14.14).
- I3: blockedBy acyclicity added to session invariants (10.1);
  10.7 next's dead "every item needing review blocked" case removed.
- I4: symlink write semantics (13.4): derived-path writes replace the
  link itself; non-plain-file durable paths are journal error / corrupt
  session (14.13, 10.1, 14.21); symlinked workspace-relative directory
  components refuse the write (new 14.22).
- O1: --test-hold creation fails if anything exists at the path.
- O2: --file glob outside-root classified as invalid flag value
  (12.0), exit 2 like 14.14.
- O3: 14.20 grammar follows the file name (.tsx parses as TSX).

Rejected:
- O4 (modularize): strategy derivations and the condition list are
  contract-level content referenced by number throughout SPEC.md;
  extraction would force forbidden references into module internals or
  duplication — no loosely coupled component exists.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…ation, split child context, empty policy kinds; tighten root-marker gloss and mixed-failure exit precedence

Applied: I1 (root precedes its file's sections in document order, 1.2), I2
(non-static bare TS reference in expression-statement position is condition
14.8 — 4.5 clarified, 14.8 enumeration extended, 14.18 carve-out added), I3
(split's per-child subtree-coherence context is the child's ancestor chain,
10.7), I4 (empty policy kinds list is a configuration error, 7.5 + 14.14),
O1 (root-marker impact gloss qualified to subtreeHash/effectiveHash changes,
4.5), O2 (rename/move argument existence and baseline resolution precede
source validation, with unparseable-file masking — 12.0 bullet + 6.4 anchor).

Rejected: none.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
@lzrscg lzrscg force-pushed the sdg/initial-build branch from 817c9bf to 81df91b Compare July 10, 2026 00:08
claude added 13 commits July 10, 2026 00:32
…it-destination scope, hash sort keys, move-import determinism

Applied: I1, I2, O1, O2. Rejected: none.

- I1: 10.2 defines baseline (fixed at item entry: recorded-baseline graph
  in baseline sessions, entry-time graph in audit/coverage) and current
  (= the 10.4 recorded state, written at creation, rewritten at each
  resolve, reported as recorded); 10.4 homes the recording in the
  current field; 10.7 next --json hashes glossed as baseline/current.
- I2: 7.3 states when configured Markdown emit destinations exist —
  only with markdown present and emit true; none when markdown is
  absent or emit is false.
- O1: 5.5 sort key for dependency-target pairs and metadataHash
  identities is the full canonical identity (identity string, then
  journal position, earliest first).
- O2: 6.5 move-added spec module imports bind fresh identifiers with
  deterministic choice and placement; rewritten file content is
  byte-deterministic for a given operation and workspace state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Record Developer's delegation of undirected implementation/tooling choices (mainstream, minimal-dependency, deterministic defaults; seed-implied stack facts are settled).
… and test harness

Developer confirmed all eight proposed choices via the Asking Developer
process: TypeScript strict/ESM/tsc on Node active LTS; remark-mdx +
TypeScript compiler API (config statically parsed, never executed);
in-repo arg parsing/glob/walking with minimal runtime deps; SHA-256 via
node:crypto with injective framing; system git read-only plumbing;
Vitest with blackbox CLI-driven E2E; Prettier only; single npm package
xspec with src/ + test/ + specs/ layout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…PEC.md section by section

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…ion contract, blackbox staging

Applied: C1 (new T12.0-11/12: git read-only around baseline reads, git-less
non-baseline surface; preamble added to H-7 traceability keys), C2 (duplicate
profile/rule names and repeated capture wildcard in T7.4-1/T7.5-1), C3 (TS
duplicate-import-binding matrix in T4-2 with non-spec negative control),
C4a-f (1.4 class boundaries in T3-3 and P-2; own-content line-drop suspension
fixture pinned in T5.5-2; 4.6 function/class-expression units and
string-literal member in T4.6-1/3; text() attribution to named units in
T4.6-1; wildcard dot-segment cases in T7-4; retained context set in T10.5-5),
I1 (H-2 sharpened: subprocess invocation of the executable is the only
channel, stated in behavior terms — PROCESS.md blackbox MUST plus SPEC.md's
declared complete interface; the conflicting in-process default in
IMPLEMENTATION.md cannot stand against it and IMPLEMENTATION.md's own
preamble yields to the specs — flagged upward for correction), I2 (H-3 and
T10.1-4: shape-dependent session-corruption fixtures staged by adapter-layer
transformation of product-written files, never from an assumed layout),
I3 (T10.4-1 full per-kind invalidation matrix with controls), I4 (T13.3-2/
T13.4-3: spec-observable operational definition of graph data), O1-O9.

Rejected: I5 — SPEC.md's silence on duplicate config-object keys is an
ambiguity in a degenerate input, not blocking per PROCESS.md (no requirement
exists there to contradict or test; product stays implementable and fully
testable), so no SPEC-PROBLEMS entry and no TEST-SPEC change — TEST-SPEC
must not invent a requirement for unspecified behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…ST-SPEC H-2

Developer-delegated conformance amendment (Liaison directive): the Test
harness section's in-process-by-default invocation (with subprocess
exceptions and bin smoke coverage) contradicted TEST-SPEC H-2, which the
Phase 6 review sharpened to subprocess-only. Replaced with: tests invoke
the xspec executable as a subprocess in all cases, fast paths included;
the product's (argv, cwd, stdout, stderr) entry (Architecture section,
unchanged) is noted as an implementation detail and not a permitted test
channel. No other section or technical choice altered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
… move regeneration, baseline replay

Applied review items (TEST-SPEC.md refinement, iteration 2):
- C1: staged every untested 14.14 arm - config syntax error (T7-2);
  markdown without emit (T7.3-1); missing profile/rule required fields,
  invalid targets/mode/boundaryKind/type enum values, unknown boundary
  and selector group names, kind mismatches (T7.4-1, T7.5-1)
- C2: new T14-5 positive grammar-selection test (.tsx parses as TSX,
  edges recorded and attributed per 4.6); 14.20 primary-test map updated
- I1: T6.5-3 now asserts the section-form move's journal append and
  finishing regeneration as T6.4-7; T6.5-2 byte-change scope aligned
  with SPEC 6.5 wording so the regeneration is not read as forbidden
- I2: T6.3-4 adds the unreplayable-mapping arm (garbage journal line,
  H-4 shape-independent) at impact --base and review create --base,
  error naming the entries, create modifying nothing (10.7)
- O1: T4.5-2 root-marker impact qualified to text edits (subtreeHash/
  effectiveHash scope of SPEC 4.5)
- O2: query section intro states information-equality via H-3, not
  byte-identity, between invocations with and without --json
- O3: T4-2 adds TS-side bare/absolute .xspec specifier form violations

Rejected: none.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…ation, metadata-terminus paths, segment-exact chains

Applied:
- C2: T10.6-3 (audit re-derivation on updated resolve) and T10.7-11 (coverage
  re-derivation with recorded profile) added; T10.7-9's split/re-derivation
  persistence assertions pinned to run in both a path-blocks and an audit session.
- C3: T9.3-2 gains the metadata-terminus arm — pure d-list edit on D, code
  location impacted via X depends-on D, witness path ends at the
  metadata-changed node with no changed node anywhere.
- I1: T2.4-4 added — computed access is segment-exact: BASE["a.b"] is
  unresolved (14.5/14.6/14.7) while local string "a.b" resolves.
- I2: T5.5-5 gains the order-insensitivity arm — reordering a d array and a
  tags list changes no hash and no categories.
- I3: T7-4 gains the literal-metacharacter arm ([1], {a,c}, !, +(x) match
  literally); P-7 and P-1 generators include these characters.
- I4: E-6 added — Windows CI leg for the platform-sensitive subset (1.5
  separator quantifier is unobservable on Linux), with cross-leg
  product-to-itself byte comparison per H-4.
- O1: T5.4-1 journaled-reintroduction variant (rename c->a after a->b).
- O2: T5.5-2 kind-distinction arm (child construct replaced by same-canonical-
  identity embedding via journaled move; ownHash must differ).
- O3: T8.2-1 root trio pinning the root-node reason's position.
- O4: T1.5-2 covers spec-group and code-group # paths.
- O5: T5.5-4 reworded — requirement nodes bear only depends/embeds edges.
- O6: T10.1-1 qualified to a freshly built workspace (13.3 refresh otherwise).

Rejected:
- C1: the proposed check-side conflicting-journal arm asserts behavior SPEC.md
  does not force — the staged journal (a->b, a->c concatenated from clones) is
  byte-identical to one reachable by valid operations (rename a->b; reauthor a;
  rename a->c; manual delete — 5.4 reintroduction, 6.6), so a conforming check
  must accept it; no blackbox staging can force the conflicting/unreplayable
  flavors of 14.13 at check beyond the malformed and non-plain-file arms
  already tested (T6.1-3, T6.3-4, T12.2-2), and asserting either direction
  would add a requirement SPEC.md does not contain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…boundary, session-name gate, Windows review leg, class attribution

Applied C1: T2.7-2 rewritten — the no-hash-change assertion now covers only the
layouts SPEC.md 3/1.6 supports (edit any layout; delete inline comment with
retained non-whitespace; delete own-line comment with its entire line), plus a
boundary arm asserting that deleting only an own-line comment's construct
characters changes the containing section's ownHash and yields `changed`.

Applied I1: T10.1-3 gains the valid-name discriminators — invalid-stem .json
files (.foo.json, "a b.json") with garbage content and wrong-case NAME.JSON are
not sessions; list exits 0, check reports no 14.21.

Applied I2: E-6 Windows fixture now includes an audit review session (create,
next --json, resolve, export) with the session file and review outputs
byte-compared across legs; audit records no creation parameters, keeping the
comparison free of git commit identities.

Applied I3: T4.6-1 gains class-as-innermost-unit arms — a marker in a class
static block and a text(...) call in a plain non-function property initializer
each attribute to bare path#C.

Applied O1: T12.0-5 native-separator negative (specs\A.mdx → exit 2), Windows-discriminating via E-6.
Applied O2: absent-scope ordering arms added to T10.6-2 (audit) and T10.7-4 (coverage).
Applied O3: kind-mismatch mirrors added to T7.4-1 and T7.5-1 (code-kind naming a spec-only group).
Applied O4: T3-3 multi-line-construct arms (residue merging, merged-empty-line drop); P-2 generator now emits multi-line comments.

Rejected: none.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…undary-overlap coverage; log SPEC 4.5/§8 problem

Applied:
- I1: T12.4-1 show/query-node comparison scoped to SPEC 12.4's enumerated
  fields; tags and coverage attribute (query-node-only per SPEC 11) are
  explicitly outside the show assertion, so the test adds no requirement.
- I2: new T8-4 — boundary-and-target overlapping populations (file in both
  spec groups, T7.1-1): a required node that is itself a boundary node with
  no incoming dependency edge is uncovered in direct and transitive modes;
  boundary membership is never a zero-length covering path.
- O2: T7-3 omitted-optional-key observations stated per key (code: no
  discovery/edges and unknown --from; markdown: no .md, T3-6; coverage:
  zero profiles exit 0; policy: no findings exit 0).

Logged as blocking SPEC problem (specs/tmp/SPEC-PROBLEMS.md):
- I3: SPEC 4.5's "a root marker grants no coverage" contradicts SPEC 8's
  path reachability once a top-level {text(...)} (2.7/2.3/1.2) makes the
  root a dependency-edge source; also unpinned for roots as spec-boundary
  members. Root-as-source fixtures held back pending Phase 4 resolution.

Rejected:
- O1: a byte-copied journal line is not guaranteed conflicting/unreplayable —
  entry bytes are opaque and a conforming product with position-independent
  entries reaches an identical duplicate via a legitimate history (rename;
  manual delete+re-author, 6.6; identical rename), after which check must
  pass; requiring a 14.13 finding would add a requirement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Applies the review round (critical:1 important:0 optional:2) per Developer
ANSWER (option 2): root nodes never participate in coverage paths, and the
fix is coverage-scoped only.

- C1 applied. SPEC 8: the reachability definition is qualified (dependency
  edges between non-root participants); the root exclusion is stated
  normatively alongside the contains exclusion - roots are never boundary
  nodes, intermediates, or targets, in either mode; a spec-group boundary
  contributes only its non-root requirement nodes; root-sourced embeds
  edges and d/text(...)/marker references targeting a root never extend a
  covering path. The exclusion is expressly coverage-scoped: roots remain
  group nodes (8.2 ignored-node reporting unchanged) and root-touching
  dependency edges remain ordinary edges for policy (7.5), impact (9.2),
  effectiveHash (5.5), and query (11). Top-level {text(...)} remains
  permitted exactly as 2.7/2.3/1.2 stand, with its root-sourced embeds
  edge and 5.5/5.6/query-edges consequences as written. 4.5's sentence is
  repaired: no coverage in any profile, because roots never participate in
  coverage paths (8), not merely because they are never targets. 1.2's
  bullet now cites both exclusions.
- O1 applied via the coverage-scoped wording above.
- O2 applied: 4.5's impact illustration now covers changes upstream of the
  document that change the root's effectiveHash.
- Rejected: none.

Rationale (Developer ANSWER): coverage must be earned through
requirement-level links (code-to-section, section-to-section);
whole-document gestures - root markers, top-level embeddings - provide
impact tracking and document composition, never coverage. GOALS.md's
"root nodes ... are never coverage targets" is the same stance at target
granularity.

Resolves the 2026-07-10 entry in specs/tmp/SPEC-PROBLEMS.md (4.5 vs 8);
the four held-back TEST-SPEC surfaces are now determinate. Problems file
deleted; no logged problems remain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…go-to-definition

Applied review items (iteration 2, re-entered refinement):
- I1: 6.5 — mirrored rename checks stated in identity terms: cross-file
  section move keeping its ID is valid; exact self-move refused, no
  journal entry; new-id collision checked against the target file after
  removal.
- I2: 11 — reachable requires a path of one or more edges, so equal
  --from/--to report no path (cycles invalid, 5.3); reachable --kinds
  accepts only dependency edge kinds, contains is an invalid flag value.
- I3: 4.2 — go-to-definition defined for root references: start of the
  source file; non-root resolves to its <S> section.
- O1: 11 cites 5.5 (not 1.2) for the absent root coverage attribute;
  12.4 show prints "identity" rather than "ID" (roots have no ID).
- O2: 7 — empty top-level coverage/policy list is valid, equivalent to
  omitting the key.
- O3: 10.2 — items are created with status unresolved at create,
  re-derivation, and split alike.

Rejected: none.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
claude added 4 commits July 10, 2026 16:46
…y (HARNESS-06)

Registry (test/helpers/registry.ts): product-facing tests as
ProductTestEntry values keyed by stable TEST-SPEC IDs, with a strict ID
grammar, duplicate rejection, loud named-subset resolution (an
unimplemented in-scope test is a hard error, never a vacuous pass, C-1),
and canonical numeric ID ordering for deterministic runs (E-5). Bodies
receive only a ProductBinding (C-2) and own their workspace lifecycle.

Certification runner (test/self/certification-runner.ts): executes the
full suite or a named subset against an arbitrary fixture product via
the same subprocess driver product-facing tests use (one code path,
C-2), attributing pass/fail/error/hang per test ID per fixture with the
H-8 taxonomy pinned by helpers/assertions.ts (fail =
HarnessAssertionError; anything else a harness defect), a per-test hang
watchdog that never hangs the run, bounded concurrency preserving
selection order, and a per-fixture report renderer for CI legibility
(C-1).

Suite wiring: test/suite/registry/index.ts is the single manifest the
runner, sweep, and Vitest wrappers share; test/suite/declare.ts declares
registered entries as Vitest tests against the built product and refuses
entries missing from the manifest.

Self-test (test/self/certification-runner.test.ts) pins all of it
against known-behavior stand-ins, including a named-subset run against a
stub product (exit 86, no output) reporting diagnosed failures only.
npm run test:self green twice (120 tests), typecheck and format:check
green; suite/windows scaffolds unaffected; src/ untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…-07)

- test/fixtures/empty-stub/bin.mjs: harness-owned empty-stub product —
  every command exits 87 (outside the SPEC 12.0 partition, distinct from
  src/'s placeholder 86) with no output and no filesystem effects, so the
  sweep stays meaningful after Phase 10 implements the product (H-8).
- test/self/s7-red-green-sweep.test.ts: pins the stub contract over a
  representative command matrix; proves the sweep premise end to end with
  a registry-convention probe body through the certification runner; and
  the S-7 sweep proper runs every manifest entry against the stub and
  requires all-fail-diagnosed with zero pass/error/hang, rendering the
  per-test fixture report on violation. Vacuous-safe while the manifest
  is empty; verified to engage, pass on diagnosed failures, and fail on
  false-pass/error bodies via a temporary manifest probe (reverted).

Cites TEST-SPEC §0 H-8, §17 S-7. npm run test:self green twice (123
tests); typecheck and format:check green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…RNESS-08)

The oracle (test/helpers/oracles/markdown.ts) independently implements
SPEC.md 3's removal/replacement/line-drop/line-terminator rules over
caller-segmented documents (pieces or spans), with the 1.4 character
classes: U+00A0/U+0085/U+2028 neither whitespace nor terminators, lone
CR a terminator, CRLF one terminator. The S-6 fixed vector suite
(test/self/s6-markdown-oracle.test.ts, 31 tests) derives every vector
from SPEC.md 3's examples and rules as restated by T3-1..T3-5,
including all drop-rule counter-cases, class boundaries, multi-line
construct merging, and chained expansion; vector discrimination was
verified by mutation (five characteristic oracle bugs each caught).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
… (HARNESS-09)

Add test/helpers/oracles/glob.ts: the in-harness matching oracle for
SPEC.md 7's glob grammar (*, ?, ** as a whole pattern segment; byte-wise
case-sensitive UTF-8 matching; the dot-segment rule read as written;
every other character literal) and SPEC.md 7.5's captures ($1..$9, one
or more bytes within a single segment, whole-pattern left-to-right
shortest-match disambiguation, to-side expansion agreement matching
captured bytes literally). Misuse (repeated from-captures, unvalued
to-references - 14.14 configuration errors) throws plain errors.

Add test/self/s6-glob-oracle.test.ts: the S-6 fixed vector suite (27
vectors) derived from SPEC.md 7's rules and 7.5's worked examples
($1-$2.ts / a-b-c.ts and *$1* / abc), including the e.mdx byte probe,
the SPECS/specs casing probe, dot-segment refusals, foreign-dialect
metacharacters as literals, and never-empty/never-slash captures.

Replaces WIP commit fc46b73 (interrupted iteration residue) with the
reviewed, verified state. Verified: npm run typecheck green; npm run
format:check green; npm run test:self green (10 files, 181 tests, the
27 new S-6 vectors included). Removes HARNESS-09 from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
@lzrscg lzrscg force-pushed the sdg/initial-build branch from fc46b73 to 6e18e8c Compare July 10, 2026 19:19
claude added 25 commits July 10, 2026 19:42
…and shrinking (HARNESS-10)

Seeded, reproducible generation over recorded choice tapes (H-10): a
mulberry32 stream drives primitive draws (intInclusive, boolean, pick,
weightedPick, listOf) recorded per trial, so one seed replays one value
sequence on every platform. Shrinking (TEST-SPEC 16) operates on the
tape — block deletion, block zeroing, per-entry binary search under
strict shortlex descent — replayed through the same generator, giving
every composed generator minimization with no per-generator shrinker.

Seed discipline (E-5): fixed default seed set (the CI mode, no env var
set in CI); XSPEC_PROPERTY_SEED=<uint32> replays a reported seed;
XSPEC_PROPERTY_SEED=random is the optional randomized local mode,
reporting each property's seed. Every falsification is a diagnosed
assertion failure (PropertyFalsifiedError extends HarnessAssertionError,
H-8) naming its seed and the shrunk counterexample; generator defects
and non-assertion body errors surface as plain harness errors.

checkProperty takes generator and property positionally so TypeScript
fixes T from the generator before contextually typing the property —
the same two members in one options object infer T as unknown.

Self-tests pin fixed-seed reproducibility, default-seed-set use, exact
minimal counterexamples (scalar 100; list summing to 10) with
deterministic repeated reports, randomized-mode seed reporting and
replay, env-seed override, seed-plan resolution, and H-8
classification. npm run test:self green twice consecutively (191
tests); typecheck and format:check green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Register the first product-facing section module: requirement sections
(T1.1-1 node reporting, T1.1-2 <S>/<Spec> equivalence incl. byte-identical
Markdown, node-set parity, shared generated skeleton, and mixed tags,
T1.1-3 self-closing empty leaves incl. childless-skeleton type error and
coverage-required default) and the implicit root (T1.2-1 bare-path
addressing and subtree order, T1.2-2 text(default export) returning the
file's entire compiled Markdown under plain Node, T1.2-3 root exclusion
from coverage targets, --coverage matching, and absent coverage
attribute). Adds shared suite staging/assertion sugar
(test/suite/registry/support.ts) over the self-tested drivers.

Verified: npm run typecheck and format:check green; all six fail as
diagnosed HarnessAssertionErrors against the built stub (exit 86);
npm run test:self green (191 tests) with the S-7 sweep now covering the
six entries against the empty stub — 6 diagnosed fails, no errors/hangs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…E-02)

Registered product-facing bodies for TEST-SPEC §1.3 in
test/suite/registry/section-1.3.ts, wrapped by
test/suite/section-1.3.test.ts and spread into the manifest: missing id
(14.1), the structural-rule matrix with expected-form mentions (14.2),
level skipping, top-level segment count both ways, duplicate IDs (14.3)
with the cross-file valid arm asserted via query nodes identities, and
14.1-masks-14.2 with the grandchild's structural check and the sibling's
14.4 still reporting. Fixtures stay within CERTIFICATIONS.md
§CONF-VALID's scope; negative arms pin the finding's file and byte
window computed from exact fixture bytes.

Shared findings machinery added to test/suite/registry/support.ts:
buildFindings (build --json, exit 1, adapter-decoded), exact
condition-multiset assertion, and finding file/location/window
assertion.

Verified: npm run typecheck and format:check green; all six observed
failing as diagnosed HarnessAssertionError against the stub product
(H-8, exit-code assertions first); npm run test:self green (191 tests,
S-7 sweep now covering 12 registered bodies).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
… (SUITE-03)

- test/suite/registry/section-1.4.ts: the four registered bodies. T1.4-1
  runs the full negative matrix (empty segment via the a → a. → a..b
  nesting and as a lone empty id, #, all six 1.4 whitespace characters,
  control representatives U+0000/U+001F/U+007F, all five forbidden names),
  each arm exactly one 14.4 located within the offending construct's byte
  window, plus a base-template positive control. T1.4-2 builds segments
  containing U+00A0/U+0085/U+2028 and queries each node by identity.
  T1.4-3 exercises bracket-notation access to a login-v2 segment through
  a consumer project (HARNESS-05): bracket access compiles clean, dot
  access errors at `login`. T1.4-4 covers tags: `.` and the three
  boundary code points valid (each exactly one unsplit tag), #, a
  forbidden name, and U+0000/U+007F failing 14.4.
- Exotic characters are constructed from hex code points in harness
  source; HARNESS-01 stages them as exact raw bytes, keeping 14.4 (not
  14.20) at stake. Certification staging constraints honored: T1.4-1
  stages none of U+00A0/U+0085/U+2028; non-whitespace controls appear
  only in T1.4-1 control arms and T1.4-4 control tag arms.
- decodeNodeSummary (adapters): minimal query-node decoding (identity +
  tags) so CONF-VALID-scoped tests demand nothing beyond that entry's
  pinned query surface; S-5 coverage added.
- byteWindow moved to registry/support.ts (shared with section-1.3).
- FIX_PLAN.md: SUITE-03 removed.

Verified: typecheck and format:check green; all four tests fail as
diagnosed HarnessAssertionErrors against the stub product; npm run
test:self green (193 tests, S-7 sweep now covering 16 registered tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…-04)

T1.5-1: every identity-bearing command (query node/nodes, show in JSON and
human form, ids, coverage, impact --base) run from the workspace root and
from a nested source directory, stdout byte-compared across the two, and
decoded identities asserted to be exactly the workspace-relative,
/-separated forms of SPEC 1.5 — edges, covering paths, ignored roots, and
impact attributions included. T1.5-2: a discovered path containing '#'
fails build with one 14.19 finding naming the path, staged once for a
spec-group file and once for a code-group file; the non-UTF-8-path arm is
staged via the workspace builder's byte-path API on the Linux leg per the
test's own text. T1.5-3: the path#id-vs-bare-path addressing duality
across query node, show, rename's file argument, file-form move, and
section-form move, discriminated by byte-anchored subtree texts.

All three observed failing as diagnosed HarnessAssertionErrors against the
stub product (H-8); npm run test:self green (193 tests — the S-7 sweep now
covers 18 registry entries); typecheck and format:check green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…1.7-1 (SUITE-05)

Register the six product-facing bodies for TEST-SPEC §1.6 (own text,
subtree text, own content) and §1.7 (source ranges) in the C-2 registry,
with the thin Vitest wrapper and manifest entry:

- T1.6-1: interleaved parent/children byte anchors verified against the
  emitted compiled output, plus the emission-independence parity arm —
  one workspace extended with an embedding, rebuilt and queried under
  markdown absent / emit:false / emit:true with anchored texts and
  cross-variant hash equality.
- T1.6-2: N+1 own-text runs with empty runs — children at the very
  start/end, adjacent in-line children, and the root's byte-0 child.
- T1.6-3: two-level expansion chain asserted via query node, show,
  an audit review payload (scope subtree text, ancestor own text), and
  text(node) at runtime through the consumer tooling driver.
- T1.6-4: embedded-target edit — target hashes change, embedder
  ownHash/subtreeHash stable while its subtree text follows the
  expansion; impact categorizes the embedder upstream-changed only.
- T1.6-5: invalid-UTF-8 and BOM sources, spec and code arms, 14.20
  with per-file findings.
- T1.7-1: zero-based byte-offset source ranges precomputed from the
  fixture parts (import line + multi-byte prefix), paired/self-closing/
  root arms, equal via query node and show.

Expected byte values cross-checked against the HARNESS-08 Markdown
oracle. All six fail as diagnosed assertion failures against the stub;
typecheck, format:check, and test:self (S-7 sweep included) green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Register the TEST-SPEC §2.1 product-facing bodies in the C-2 registry with
their thin Vitest wrapper: valid default import with binding resolution
asserted via query edges; the ../-resolution positive arm plus the five
invalid-specifier 14.15 arms; the binding-form matrix (named/namespace/
side-effect, duplicate-identifier collision, S/Spec/text bindings, and the
two-names-one-module positive arm); unused import records no edges; and the
two-file and self-import 14.9 cycle arms with acyclic requirement-level
dependencies.

All five observed failing-as-diagnosed against the stub product (H-8);
npm run test:self green (193 passed, S-7 sweep included); typecheck and
format:check green. SUITE-06 removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…1…T2.3-2 (SUITE-07)

Register the seven product-facing bodies for the d prop (forms, bare-module
root target, duplicate collapse, empty-array metadataHash parity, Markdown
no-trace byte assertion) and text(...) embedding (byte-asserted subtree-text
replacement with embeds edges; string form resolved same-file against a
decoy, depth-three and whole-file root targets), wire them into the suite
manifest, and drop SUITE-07 from the fix plan.

All seven fail as diagnosed assertion failures against the stub product
(H-8); typecheck, format:check, and npm run test:self (193 tests, S-7 sweep
included) are green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
… (SUITE-08)

Register the four TEST-SPEC §2.4 product-facing tests in
test/suite/registry/section-2.4.ts with the thin Vitest wrapper and
manifest entry:

- T2.4-1: every accepted static form (double/single-quoted strings,
  dot chains, computed access via static string literal with both
  quote styles, mixed chains) in `d` and `text(...)` builds, each
  form pinned to its recorded depends/embeds edge.
- T2.4-2: all six dynamic forms (template literal; identifier and
  call as index; optional chaining; non-null assertion; parenthesized
  chain; conditional expression) fail with exactly one located 14.8,
  in `d` and in `text(...)`, in MDX — 14 one-defect workspaces.
- T2.4-3: `text()` arity zero and two -> 14.8, with resolvable
  arguments so arity is the only defect.
- T2.4-4: segment-exact computed access — `BASE["a.b"]` fails 14.5 in
  `d`, 14.6 in `text(...)`, 14.7 as a TypeScript marker plus the
  type-error arm against the generated module under standard tooling
  (HARNESS-05), while `BASE["a"]["b"]`, `BASE.a.b`, and local
  `d={"a.b"}` resolve (with an imported-file decoy for the local
  string).

Verified: typecheck and format:check green; all four fail as
diagnosed assertion failures against the stub product (H-8); test:self
green (193 tests) with the S-7 sweep covering the new registrations.

SUITE-08 removed from specs/tmp/FIX_PLAN.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…5-1…T2.6-3 (SUITE-09)

- T2.5-1: attribute-less non-root nodes are coverage-required — profile
  required set plus `query nodes --coverage required`.
- T2.5-2: coverage="none" in one workspace — ignored with its single
  reason under targets:"all", still a `d` target, children remain
  required, and the edited node still appears `changed` in
  `impact --base` against a scripted git baseline.
- T2.5-3: coverage="required" behaves as the default (membership,
  reported attribute, metadataHash equality across in-place variants);
  "optional"/"None"/"" each fail 14.17, located by byte window.
- T2.6-1: splitting — single space, mixed tab/VT/FF/space run,
  CR LF tab run, and padded spellings all yield {a, b} via `query node`
  and `query nodes --tag`, with cross-arm metadataHash identity.
- T2.6-2: duplicates collapse (hash equals plain spelling); tags="" and
  whitespace-only equal the omitted variant's metadataHash.
- T2.6-3: byte-exact emitted Markdown carries no tag trace; no
  inheritance; targetTags restricts the required set; a forbidden
  policy rule with tags selectors flags exactly the tagged edge.

T2.6-1/T2.6-2 stay within CERTIFICATIONS.md §CONF-VALID scope: new
minimal H-3 decoders (identity/tags/metadataHash node summary, and
identity/tags rows) demand nothing beyond the scoped query surface;
fixtures split only on true 1.4 whitespace (§VIOL-VALID-WIDE) and stage
no control characters (§VIOL-VALID-CTRL). S-5 covers both new decoders.

Verified: typecheck, format:check, and test:self green (197, S-7 sweep
included); all six new tests fail as diagnosed HarnessAssertionErrors
against the stub product (H-8). SUITE-09 removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…(SUITE-10)

Register the SUITE-10 bodies (C-2 one code path): T2.7-1 foreign
constructs (a JSX element other than <S>/<Spec>, an expression container
other than text(...) or an MDX comment, an export statement — each
exactly one 14.16, located); T2.7-2 comments absent from Markdown output
and own text, hash/category stability against a committed baseline for
comment-content edits (inline and own-line), inline-comment deletion,
and whole-line own-line-comment deletion, plus the emptied-line boundary
(section ownHash changes, changed with the 5.6 cascades, kept line
contributing its terminator — byte-asserted against the S-6-oracle-
cross-checked compilation); T2.7-3 invalid-prop matrix (repeated defined
and unknown props, unknown prop, spread attribute, braced id/coverage/
tags values, quoted and valueless d — 14.17; braced d holding a number
or object literal — 14.8) and the positive quoting arm (single-quoted
props build byte-identical Markdown and equal full node reports to the
double-quoted variants; generated-module and graph-data bytes not
pinned across different sources per H-4, the T1.1-2 precedent).

All fixtures verified well-formed MDX; typecheck and format:check
green; the three tests fail as diagnosed assertion failures against
the stub (H-8); npm run test:self green (197 passed, S-7 sweep over
the enlarged registry included). SUITE-10 removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…E-11)

Registered product-facing bodies for TEST-SPEC §3: removals with the full
2.7 prop set (T3-1), chained text() replacement A→B→C plus local form
(T3-2), the line-drop rule with all counter-cases, 1.4 class boundaries,
and multi-line-construct merges (T3-3), CRLF/LF/lone-CR terminators and
terminator-less final lines (T3-4), in-line tags (T3-5), and the 7.3/13.2
emission-scope matrix (T3-6). CONF-MD staging constraints honored:
U+00A0/U+0085/U+2028 only on T3-3's class-boundary lines; lone CR only in
T3-4. All six observed failing as diagnosed assertion failures against the
stub (H-8); typecheck, format:check, and test:self (197, S-7 sweep
included) green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Generated-module header (leading comment region mentioning xspec and the
source file, per module); the full TS import-rule 14.15 matrix — target,
form, and binding rules, all four export-declaration forms, import =
require, static-specifier dynamic import, the 4-form x 3-kind derived-path
cross product, and duplicate-binding collisions in both orders with the
non-spec-collision and non-static-dynamic-import positive arms; aliased
default and text bindings type-checking, recording the embeds edge, and
returning subtree text at runtime under plain Node; type-only imports as
type-level names recording nothing with the ordinary-binding control.

Typecheck and format green; all four fail as diagnosed HarnessAssertionError
against the stub product (H-8 red baseline); npm run test:self green (197,
S-7 sweep over the grown registry included).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…-13)

T4.1-1…T4.1-3 and T4.2-1…T4.2-4 as registered product-facing bodies
(test/suite/registry/section-4.1-4.2.ts) with the thin Vitest wrapper:
skeleton chains to leaves incl. a bracket-notation non-identifier segment,
missing-path and readonly type errors at the consumer reference, opaque node
values (text() acceptance + byte-exact subtree text at runtime, and a
never-imports-text probe observing no requirement text on node values), doc
comments containing exact expanded own text, 1000-code-point truncation
discriminated from UTF-16-unit and byte cuts, */ -> *\/ escaping, and
go-to-definition/hover into the source .mdx.

helpers/tooling.ts grows sourceDefinitionsAt: raw language-service
definitions mapped through declaration maps via the service's internal
source mapper — the tsserver mechanism editors use, without which no product
could satisfy SPEC 13.1's go-to-definition-into-.mdx under the raw API; a
new S-4 self-test pins availability and mapping into a non-TS original.
readGeneratedModule hoisted to registry/support.ts (shared with section-4).

Verified: typecheck and format:check green; test:self green (198, S-7 sweep
covers the new bodies); all 7 new tests fail as diagnosed
HarnessAssertionError against the stub product (H-8 red baseline, 67 red /
1 scaffold pass suite-wide).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…E-14)

T4.3-1: text(node) returns subtree text as a string at runtime (typeof +
byte-compared expansion through a child and an embedding) and records its
embeds edges from the calling code location, asserted as the file's
complete outgoing edge set via query edges.

T4.3-2: a string argument to text in a TypeScript file, a computed index
by variable, and an optional-chaining chain each fail build with exactly
one located 14.8 finding; dynamic chains resolve under a static reading so
the form is each arm's sole defect.

T4.4-1: cross-module text call — exactly one located 14.11 build finding
in a discovered code file; TypeScript type error at the consumer
reference; executed via the emitted JS the call throws naming both
modules (asserted via distinctive source-name stems over the error's
standard renderings).

T4.4-2: two spec modules in one file with aliased text imports — each
alias accepts its own module's nodes (clean compile, byte-exact runtime
texts) and rejects the other's (compile error at each cross argument).

All four fail as diagnosed HarnessAssertionErrors against the stub (H-8);
typecheck, format:check, and test:self (198 tests) green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…UITE-15)

Register the seven TEST-SPEC §4.5 bodies in test/suite/registry/section-4.5.ts
with the thin Vitest wrapper and manifest entry: marker semantics with the
runtime as-if-absent byte comparison against a marker-free control under plain
Node (T4.5-1); root marker's references edge, no coverage in either profile
mode, and direct impact with the forced witness edge and path over a committed
git baseline (T4.5-2); five non-static bare-reference forms each exactly one
located 14.8 finding (T4.5-3); scope-aware shadowing with an identical-text
control marker (T4.5-4); eight unsanctioned value-level uses each exactly one
located 14.18 finding (T4.5-5); statement-position text(...) recording embeds
and no references via --kinds (T4.5-6); type-level freedom — no edges, bytes
untouched by rename, workspace stays valid (T4.5-7).

typecheck and format:check green; test:self green (198 passed — S-7 sweep
covers the new bodies against the stub); all 7 new tests fail as diagnosed
HarnessAssertionError assertion failures against the stub product (H-8).
Remove SUITE-15 from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
Register the code-location attribution matrix: T4.6-1 covers every
named-unit form (functions, class members incl. static blocks and plain
property initializers attributing to the bare class, function/arrow/class
valued properties and variables, plain and dotted namespaces, named
default export) with markers and text(...) calls sharing one placement
table so both edge kinds must attribute to the same innermost unit;
T4.6-2 the anonymous default's #default unit; T4.6-3 not-named-units
(IIFEs, destructured functions, computed/string/numeric/private member
names) falling back to the nearest named unit or file, never a #-named
unit; T4.6-4 duplicate chains via a getter/setter pair and same-named
declarations in sibling blocks, the @2 identity asserted through query
edges, --from addressing, and coverage boundary membership.

typecheck + format:check green; test:self green (198, S-7 sweep incl.);
all four observed failing as diagnosed assertion failures against the
stub (exit 86 vs expected 0) — the expected Phase 9 red baseline.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
T5.2-1: one workspace exercising all four edge kinds (contains from
document structure, depends from d, embeds from MDX and TS text(...),
references from a marker), asserted as the complete unfiltered `query
edges` set with a duplicate declaration staged per dependency kind so
collapse (SPEC 5.2) is enforced for each.

T5.3-1: six cycle fixtures at `check --json`, each reported at exit 1
with the full cycle path (rotation-invariant, open/closed form; never
reversed or partial): a cross-file depends cycle (its unavoidable
mutual-import spec import cycle accounted for per the T2.1-5
convention), a mixed contains+embeds cycle, self-depends and
self-embeds of length one, and a section depending on / embedding its
own grandparent (the path must include the intermediate section).

T5.3-2: build also rejects dependency cycles — a two-node depends
cycle fails build with one 14.9 finding carrying the full path, and
check reports the same (14.9 is a build-and-check condition).

All three fail as diagnosed assertion failures against the stub
product (H-8, observed); typecheck, format:check, and test:self (198,
S-7 sweep included) green. SUITE-17 removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
… T5.4-2 (SUITE-18)

Register the two TEST-SPEC §5.4 product-facing tests in a new
test/suite/registry/section-5.4.ts with its thin Vitest wrapper:

- T5.4-1 reintroduced identity: the manual-reintroduction fixture carries
  the base assertions (renamed node unchanged, reintroduced identity
  added-only, rewritten dependent without upstream-changed) plus both
  journal-position arms — the byte-restored embedder retargeted N1→N2
  reports changed, and twin embedders of N1-spelled-b vs N2-spelled-a
  have differing ownHashes — with the own-hash coincidence control; the
  journaled variant (rename a→b then c→a) asserts the both-bearer
  dependent keeps every hash and impact --base reports no entries.
- T5.4-2 spelling never hashes: rename-performed dot→computed rewrite
  (non-identifier segment) and kept-computed re-spelling, move-performed
  local string ↔ imported form conversions in both directions, and the
  manual re-spelling arms (computed→dot; quote style) with rebuild and
  whole-fixture query-node hash comparison.

Both tests observed failing as diagnosed HarnessAssertionErrors against
the stub product (H-8); typecheck, format:check, and all 198 harness
self-tests green. SUITE-18 removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
All six registered bodies drive the built product as a subprocess and
compare opaque hash values only by self-comparison (H-4): the H-6
two-directory reporting/determinism protocol; the ownHash change matrix
with the mandated line-drop-toggle arm and the child-vs-embedding kind
distinction staged via a journaled section move; the subtreeHash
condition matrix with sibling and embedded-target controls; the
effectiveHash matrix including the per-edge dedup-discriminating arm and
the equal-effectiveHash twin retarget; the metadataHash iff matrix with
the root empty-inputs arm and d/tags order-insensitivity asserted through
hashes and an empty impact report; and the purity link's full-workspace
hash sweep across a journaled rename and file-form move.

Expected red against the stub product: all six fail as diagnosed
assertion failures (H-8). Harness self-tests pass (198/198); typecheck
and format:check green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…TE-20)

Registered product-facing bodies for the impact --base category matrix
against committed git baselines: the leaf-edit worked example, child
add/remove, d-target edit, coverage/tags-only edit, multiple flags, and
the added/deleted convention — each asserting the SPEC 5.6 categories
with attribution (9.1) over a complete per-node expectation table, plus
the empty impacted-code control.

Propagated-category attributions (descendant-changed, upstream-changed)
are pinned exactly per TEST-SPEC's text; originating categories
(changed, metadata-changed), whose attribution no test text pins, are
bounded to the fixture's originating-node set (H-4, noted in the module
header). Assertions merge categories per node identity across report
entries, leaving entry granularity/collapsing to T9.3-1.

Verified: typecheck and format:check green; all six fail as diagnosed
HarnessAssertionErrors against the stub product (H-8 red); test:self
green twice (198 tests, S-7 sweep covering the new bodies). SUITE-20
removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…UITE-21)

Register the three TEST-SPEC §6.1 tests in the product-test registry
(test/suite/registry/section-6.1.ts) with their thin Vitest wrapper:

- T6.1-1: journal absent after build in a fresh workspace; appears at
  .xspec/journal with the first rename; each subsequent operation (file-form
  move, rename) appends exactly one line-oriented entry with the prior bytes
  a byte prefix; build/check/coverage/impact/review/query byte-compared
  around each, impact --base as the git-less exit-2 case.
- T6.1-2: the same rename, then the same file-form move, in two identical
  directories append byte-identical entries (with a rewrite-determinism
  premise guard between the operations).
- T6.1-3: check reports 14.13 for a harness-appended garbage line (naming
  line 2 via location window, content echo, or line citation) and for a
  journal path occupied by a directory or a symlink to an empty file.

T6.1-1/T6.1-2 fixtures stay within CERTIFICATIONS.md §CONF-CORE scope
(one importless spec group, no code/markdown/coverage/policy keys, no git,
mutating commands only rename and file-form move).

Verified: typecheck and format:check green; npm run test:self green
(198 passed, S-7 sweep covers the new bodies); the three new tests fail as
diagnosed HarnessAssertionError against the stub product (expected red).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…SUITE-22)

Register the four TEST-SPEC §6.2 bodies in test/suite/registry/section-6.2.ts
with the thin Vitest wrapper test/suite/section-6.2.test.ts:

- T6.2-1: rename purity — full-workspace four-hash sweep (query nodes
  enumeration premise + per-node query node) and impact --base against the
  pre-rename git baseline empty in requirements and both impacted-code
  groups, over a fixture with a code location bearing a marker and a
  text(...) call targeting renamed nodes (journal unification, SPEC 9.2).
- T6.2-2: file-move purity — same assertions across specs/Core.mdx →
  specs/sub/Moved.mdx with the moved file's own import specifier and other
  files' imports rewritten; identities change only in their file part.
- T6.2-3: section-move impurity — clean-boundary arm keeps ownHash,
  subtreeHash, metadataHash on every moved node with only the two parents
  changed and their cascades attributed per parent; impure-boundary arm
  (SPEC 6.2's worked case) additionally reports the moved node changed with
  its metadataHash kept and the upstream cascade attributed exactly to it.
  Two-sided descendant-changed on the parents is tolerated only when
  attributed to the moved node (documented H-4 operationalization).
- T6.2-4: same-parent final-position move — full sweep unchanged, impact
  empty, reference respellings rewritten.

Verified: npm run typecheck and format:check green; the four tests fail as
diagnosed assertion failures against the stub product (exit 86 at build,
H-8); npm run test:self green (198 tests, S-7 sweep included).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…(SUITE-23)

Registered product-facing bodies for TEST-SPEC §6.3: config-at-ref group
membership (added file absent from the baseline side); absent journal in
both directions (pre-journal baseline resolves normally; journal deleted
currently is a prefix violation); replay composition across a mid commit
(a→b→c maps a→c, no changes); and the exit-2 failure matrix — rewritten
journal prefix violation, garbage replay line at `impact --base` and
`review create --base` (naming the entry, create modifying nothing),
unparseable baseline sources naming the file, unresolvable ref echoing
it, and the baseline-resolution-precedes-source-validation precedence
arm (exit 2, empty stdout under --json, modifies nothing).

All four observed failing as diagnosed HarnessAssertionErrors against
the stub product (H-8); typecheck, format:check, and test:self (198,
S-7 sweep included) green. SUITE-23 removed from FIX_PLAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
…ts (SUITE-24)

T6.4-1…T6.4-7 in test/suite/registry/section-6.4.ts: rewrites across all
reference surfaces with query-asserted edge retargeting and the journal
mapping; byte-exact minimal-edit arms (identifier and non-identifier new
segments); validation refusals with whole-workspace modifies-nothing
compares; usage-error ordering and the unparseable-origin 14.20 masking
arm; type-level references left unrewritten with build/check staying
green; the valid-workspace precondition; finishing regeneration compared
whole-tree against a fresh build plus a clean check (14.10).

T6.6-1 in test/suite/registry/section-6.6.ts: a direct-edit rename never
creates the journal, impact reports the old identity deleted plus the new
one added (full per-node category table, never continuity), and both a
same-file and a cross-file dependent fail 14.5 — located to their
reference constructs — until manually rewritten.

Wired into the manifest with thin Vitest wrappers. All 8 fail as
diagnosed HarnessAssertionErrors against the stub (H-8); typecheck,
format:check, and npm run test:self (198 passing, S-7 sweep included)
green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XRjC6q66ab9mDaqgFZnDZ
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.

2 participants