Skip to main content

Code Sync Audit

Status: governance reference — populated incrementally by waves. Wave D fills the Valenar-docs and SECS-design-docs sections. Other artifact sections are deferred to future waves and are marked explicitly. Status vocabulary in this doc follows pr-status-and-sync-policy.md.

Known Blockers At Wave Start

This section enumerates dirty-tree drift that existed in the working copy at the moment Wave D began, so future verifier passes can distinguish between Wave-D-introduced changes and inherited drift. The items here are explicitly out of Wave D scope (Wave D is docs-only per the wave matrix) and are recorded so that a subsequent verifier does not re-flag them as Wave D regressions. The Wave 0 explorer report enumerated these files in its "Repo state" section; this subsection is the audit-trail home for that enumeration.

Pre-Existing Build Break — Engine Resolver Rename Migration

A prior recovery wave began renaming the engine's primary stat-channel resolver type but did not propagate the rename to the consumer projects. As a result, dotnet build SECS.sln fails at the working-tree state Wave D inherited.

  • Wave that introduced the drift: prior recovery wave (not Wave D).
  • Build-failure sites (8 errors at conversation start):
    • benchmarks/SECS.Benchmarks/ScenarioBuilder.cs:69
    • benchmarks/SECS.Benchmarks/BenchmarkHost.cs:38 (×2)
    • benchmarks/SECS.Benchmarks/BenchmarkHost.cs:41
    • benchmarks/SECS.Benchmarks/HierarchicalScenario.cs:103
    • examples/character-trainer/Host/Bridge/HostBridge.cs:16
    • examples/character-trainer/Host/GameRuntime.cs:11
    • examples/character-trainer/Host/GameRuntime.cs:28 (×2)
  • Drift shape (per pr-status-and-sync-policy.md vocabulary): drift between current (consumer projects reference the prior engine resolver type name) and target (engine type was renamed). The fix is mechanical — update the eight call sites to the new type name — but it is a code change, not a docs change.
  • Wave D scope decision: NOT fixed in Wave D. Wave D is docs-only per the wave brief; touching benchmark or character-trainer source is outside the Wave D patch envelope.
  • Where the fix belongs: a future engine/runtime wave (Wave C in the recovery matrix, or a dedicated build-fix wave). Until that wave runs, dotnet build SECS.sln is expected to fail with these eight errors and verifier passes should treat the build break as a known blocker rather than a Wave D regression.
  • Reference for migration context: docs/copilot-stat-channel-migration.md:454 documents the rename history.
  • Assigned wave: Wave 0-Build (see pr-wave-roadmap.md § Wave 0-Build).
  • Resolved by: Wave 0-Build. All 11 StatResolver -> ChannelResolver consumer occurrences across 5 files were renamed. dotnet build SECS.sln returns 0 errors after this change. Status: CLOSED.

Pre-Existing Staged Drift In Companion Rule Files

The git status at the start of Wave D's session showed a set of files already in modified state in the working tree, before any Wave D edit ran. These modifications are content-correct (they update vocabulary in companion governance files) but predate Wave D and are not attributable to it.

  • .claude/rules/behavior-vocabulary.md — staged before Wave D began. Wave D's companion vocabulary edit went to docs/design/behavior-vocabulary.md, a different file. The pre-existing modification of the .claude/rules/ mirror is permitted under the meta-fix exception in .claude/rules/orchestrator-mode.md ("Edits that only change CLAUDE.md, .claude/rules/, settings, hooks, or auto-memory files are small and self-contained. The orchestrator may execute these inline rather than dispatching."), so no fix wave is required. The note exists to prevent future verifier passes from re-flagging the modification as a Wave D change.
  • Benchmark consumer files participating in the resolver-rename build break above:
    • benchmarks/SECS.Benchmarks/AllocationBenchmarks.cs
    • benchmarks/SECS.Benchmarks/BenchmarkHost.cs
    • benchmarks/SECS.Benchmarks/CachedHierarchicalBenchmarks.cs
    • benchmarks/SECS.Benchmarks/CommandProcessBenchmarks.cs
    • benchmarks/SECS.Benchmarks/HierarchicalBenchmarks.cs
    • benchmarks/SECS.Benchmarks/HierarchicalScenario.cs
    • benchmarks/SECS.Benchmarks/QueryBenchmarks.cs
    • benchmarks/SECS.Benchmarks/ScenarioBuilder.cs
    • benchmarks/SECS.Benchmarks/StatResolutionBenchmarks.cs
  • Character-trainer consumer files participating in the same build break:
    • examples/character-trainer/Host/Bridge/HostBridge.cs
    • examples/character-trainer/Host/GameRuntime.cs
  • Fix wave: the benchmark and character-trainer files share the same fix wave as the build break above (future engine/runtime wave). The .claude/rules/behavior-vocabulary.md modification needs no separate fix wave.

Purpose

This document tracks where committed Valenar docs, Content/, Generated/, Host/, Server/, Client/, src/SECS.*, tests/, and scripts/ diverge from each other or from the design contract. It is populated by waves; each wave fills the artifact-class sections it audits. It is the machine-readable record of drift between current implementation and target design — per-doc status blocks summarize, this doc enumerates.

When a wave audits a section, it appends a wave-labeled subsection rather than overwriting prior wave findings. Closed drift items (where the implementation is brought up to the target) are kept in the audit trail so that future readers can see what was wrong, what was fixed, and which wave fixed it.

How To Use This Document

Readers looking for the authoritative design use the doc tree (the systems/, generation/, acts/, catalogs/, and ux/ directories). Readers looking for known drift between design and implementation use this doc. Each artifact class has a top-level section; each section has one or more Wave <Letter/Number> subsections for the wave that audited it. Empty subsections say (deferred to Wave <ID>) using the wave-id convention from the wave brief. Open questions raised by an audit but not resolvable at audit time go in pr-open-questions.md, with this doc cross-linking to them.

Valenar Docs

Wave D

Wave D applied 10 patch-target edits to the Valenar docs tree to remove the deprecated behavior-noun and planning-noun vocabulary as live nouns and to fix two Location-scale parentheticals that misled readers about Location geometry. The deprecated terms are documented in docs/design/behavior-vocabulary.md; the audit below describes the rewrites without re-quoting them inline.

  • examples/valenar/docs/systems/objectives-clues-missions.md — H1 rewritten to "Objectives, Clues, Missions, and Activities" (the prior H1 ended with the deprecated planning-noun). Core Terms, Relationship Between The Layers, and Design Rules sections rewritten to remove the deprecated planning-noun as a live planning category and to introduce routine activity and composite activity as planning-layer sub-forms of activity (per the ADR-aligned behavior vocabulary in docs/design/behavior-vocabulary.md).

  • examples/valenar/docs/ux/current-plan.md — three substitutions removing the deprecated planning-noun and replacing it with composed-activity language at lines describing the active mission rollup, the active composed-activity context bullet, and the traceability rule.

  • examples/valenar/docs/ux/objectives-screen.md — three substitutions removing the deprecated planning-noun from the "approach" wording, the "active noun" listing wording, and the "Do not let noun replace" guidance line, all replaced with composed-activity phrasing.

  • examples/valenar/docs/systems/camp.md — one substitution rewriting "can surface as deprecated planning-noun" to "can surface as routine activity shapes".

  • examples/valenar/docs/glossary.md — Technique definition rewritten to remove the deprecated capitalized behavior-noun and planning-noun pair and to use activities, missions, and assignments instead.

  • examples/valenar/docs/systems/character-skills.md — two substitutions removing the deprecated capitalized behavior-noun and planning-noun pair from the "noun-list, Missions, or Assignments" enumeration and from the "Techniques, noun-list, Missions, and Assignments" enumeration, replaced with the activities/missions/assignments wording.

  • examples/valenar/docs/ux/combat-dungeon-screen.md — six substitutions: round-log row label rewritten so the fired noun is activity instead of the deprecated behavior-noun; behavior-branch field name updated to activity_ref (the field previously used the deprecated behavior-reference field name); resolver wording rewritten so a resolver activity takes a behavior reference (the prior wording used the deprecated resolver behavior-noun); the paired sentence about the resolver invoking the highest-weighted branch's behavior rewritten to activity; the "the resolver is itself a deprecated noun" paragraph rewritten to use activity and activity call path; and the cross-link line previously referring to the deprecated behavior-primitive wording rewritten to activity primitive. The proposal-doc nature of this file is unchanged; the substitutions are vocabulary fixes inside the proposal.

  • examples/valenar/docs/README.md — index entry for gd-realm-ranks-and-polity.md rewritten from "realm creation, rank, founding tier, and crown-scale capabilities" to "polity ladder above settlements, founding tier, and crown-scale capabilities" to remove the "realm creation" wording that contradicted the canonical line that there is no single Realm birth moment. Index entry for gd-objectives-clues-missions.md rewritten to match the new H1.

  • examples/valenar/docs/generation/location-generation-contract.md — the (~50 km × 50 km) parenthetical at the Location Scale description rewritten to (an irregular Voronoi polygon at this scale). The fix preserves the 250–500 km² area but removes the square-cell implication.

  • examples/valenar/docs/generation/world-generation-contract.md — the matching (a ~50 km × 50 km strategic cell) parenthetical rewritten to (an irregular Voronoi cell at this scale).

Wave D also created six new Valenar docs: implementation/status-and-sync-policy.md, implementation/code-sync-audit.md (this file), implementation/open-questions.md, systems/tags-and-classification.md, catalogs/tag-catalog.md, and systems/state-axes-and-thresholds.md. Inbound links from examples/valenar/docs/README.md were added in a single pass.

Wave D-Journal Readback Drift

Wave D's Journal owner-doc pass now anchors durable narrative readback in gd-journal.md and sharpens the ownership split with gd-current-plan.md, gd-location-dossier.md, gd-objectives-screen.md, gd-objectives-clues-missions.md, gd-quest-and-lore-design.md, gd-canon.md, and gd-glossary.md. The accepted Journal code slice now ships the baseline runtime/client alignment that this owner-doc pass was pointing at: a dedicated Journal query/version/client path exists, Journal-class narrative memory no longer depends on a raw flat log surface, and Chronicle remains the separate combat-only chronology lane. The remaining drift is narrower and stays below the full contract in the following deferred areas:

  • Journal target vs raw-log surfaces — baseline implemented; narration-safe follow-through deferred. gd-journal.md defines a clean split between readable Journal prose and optional narration-safe readback. The dedicated Journal path now owns Journal-class narrative memory, so raw-log or event-log wording is no longer the target surface. What remains deferred is the separate narration-safe text path, not the baseline Journal surface itself.

  • Journal vs Chronicle separation — baseline implemented. gd-journal.md, gd-canon.md, and gd-quest-and-lore-design.md keep Journal for durable day-based narrative memory and Chronicle for combat chronology only. That boundary is now present in the accepted runtime/client slice. Remaining follow-through is richer cross-surface context, not any merger of Chronicle back into Journal.

  • Annotations and player notes. gd-journal.md defines annotation layering as part of the target contract, but player-authored notes and richer annotation affordance remain deferred.

  • Deeper Current Plan linking. gd-current-plan.md and gd-journal.md describe a tighter Journal-to-plan readback loop than the accepted baseline currently ships. Deeper Current Plan linking remains deferred.

  • Richer site / lore-artefact / faction metadata. gd-journal.md allows broader metadata and link depth than the accepted baseline currently exposes. Richer site, lore-artefact, and faction metadata remain deferred.

  • Core / camp / settlement / realm progression wording — shipped; no longer a broad deferred cleanup slice. The accepted runtime/client slice now separates these states explicitly: Core establishment creates the anchor and nearby reveal only; it does not create the first settlement or a Realm-birth moment. The first settlement is a later camp-gated step at the established Core location, and settlement, realm/governance, and construction surfaces stay locked until that first settlement exists. gd-core-base.md, gd-canon.md, and gd-glossary.md remain correct that Core Base is legacy wording only. The residual in this area is no longer broad wording cleanup; only genuine Journal follow-through or any truly still-open Journal-only raw-log phrasing remains deferred.

The remaining Journal follow-through is tracked in pr-wave-roadmap.md. Wave J should now be treated as a follow-through wave for these deferred Journal items, not as first delivery of the dedicated Journal path or the Journal/Chronicle split, and not as the owner of the already-shipped Core -> camp-gated first-settlement -> settlement-gated realm/governance/construction wording slice. Rollout-sequencing decisions live in pr-open-questions.md.

Wave D-Story-Authoring Pipeline Follow-Through

This follow-through wave did not change lore truth, design truth, runtime surfaces, or story prose. It aligned docs/process surfaces around the already committed story layer from ad-0003-story-content-layer-and-agent-audit.md.

  • examples/valenar/docs/implementation/pr-llm-story-authoring-pipeline.md — new thin process doc that points local LLM agents to the committed story README, entry template, indexes, and ADR instead of re-embedding those rules; records the AGENTS.md / CLAUDE.md vs skills vs subagents split; marks story-specific skills and story-specific subagent files as future required rather than currently committed; and records the read-only auditor policy plus the current manual verification commands.

  • examples/valenar/docs/README.md — added a Story section linking the story README, entry template, all five indexes, and the new pipeline doc; also added the pipeline doc to the implementation-doc index so readers can reach the process surface from the main docs hub.

pr-open-questions.md remained unchanged because this follow-through wave did not surface a new decision that needs user input or a separate ADR. The lore prefix convention file also remained unchanged because ADR 0003 already established that the story layer sits outside the lore-tree prefix scheme.

Future required state remains deferred: dedicated story-specific skills, story-specific subagent files, and dedicated validators are not yet committed. This subsection records the governance scaffold so later waves can add those assets without collapsing the story/non-canon boundary.

SECS Design Docs

Wave D-Behavior Vocabulary

docs/design/behavior-vocabulary.md — the Wave 3 cleanup note was inaccurate: it claimed Wave 3 had removed the Valenar player-doc carve-out for the deprecated capitalized behavior-noun and planning-noun, when the actual doc cleanup happened in Wave D. Wave D updated that line to reference Wave D and to enumerate the player-facing Valenar docs cleaned by this wave.

The Group A allowlist section was extended with a normative bullet clarifying that Routine Activity and Composite Activity are planning-layer sub-forms of activity — not SECS keywords, not runtime nouns, and not separate behavior kinds. Routine Activity describes a reusable composed pattern; Composite Activity describes a one-time composed approach for a mission or complex operation. Both lower to sequences of atomic activity queue entries at execution time.

Content/

(deferred to Wave S)

Generated/

(deferred to Wave G)

Host/

(deferred to Wave L)

Server/

(deferred to Wave L)

Client/

(deferred to Wave Cl)

src/SECS.*

(deferred to Wave S)

tests/

(deferred to Wave T)

scripts/

(deferred to Wave T)

Open Drift Items

The following drift items are surfaced by Wave D for tracking but are not closed by Wave D. They live here as anchors and are cross-linked from the relevant design docs.

  • Location knowledge axis: prototype vs target ladder. CLOSED by Wave R-1 (2026-05-10). The int Explored binary on LocationData was replaced by the eight-step LocationKnowledgeState enum (Unknown -> Sighted -> Scouted -> Surveyed -> Secured -> Claimed -> Cleansed -> Developed) plus a forward-compat int KnowledgeIntensity nuance field. The enum lives in examples/valenar/Generated/Locations/LocationKnowledgeTypes.cs; the scope-field row pair is registered through H.KnowledgeState / H.KnowledgeIntensity in Generated/Hashes.cs + Generated/Declarations.cs. Numeric intensity thresholds remain TBD per systems/state-axes-and-thresholds.md "Location Knowledge Axis".

  • Site numeric intensity field. CLOSED by Wave R-2 (2026-05-10). int StateIntensity was added to SiteData with a verified FNV-1a-64 hash constant (H.StateIntensity = 0x2BD07323BBB9FC07UL), a ScopeFieldDeclaration row in Generated/Declarations.cs, and read/write paths through the Site branch of HostBridge. Content/locations/sites/scopes.secs is in sync. The field tracks intensity on the State (progress ladder) axis, not on DiscoveryState. Default 0; numeric thresholds within each ladder label remain TBD per a future balance wave. Wire projection (SiteSnapshot) is deferred to a future Server wave. Resolved by: Wave R-2. Status: CLOSED.

  • Feature numeric intensity field. CLOSED for the field foundation by Wave R-3 (2026-05-10). int DiscoveryIntensity was added to FeatureData with a verified FNV-1a-64 hash constant (H.DiscoveryIntensity = 0x6B8E15B1072C893AUL), a ScopeFieldDeclaration row in Generated/Declarations.cs, and read/write paths through the Feature branch of HostBridge. Content/locations/features/scopes.secs is in sync. The field tracks intensity on the DiscoveryState ladder. Default 0; bare integer per the unified convention established by R-1's KnowledgeIntensity and R-2's StateIntensity. Wire projection (FeatureSnapshot.discoveryIntensity) is deferred to a future Server wave, mirroring R-2's SiteSnapshot deferral. Resolved by: Wave R-3. Status: CLOSED for the field foundation.

  • Feature numeric intensity thresholds. The 0–100 intensity ranges per FeatureDiscoveryState label are design intent but not committed values per the authority doc's explicit balance-pass deferral. Wave R-3 shipped the field foundation only (int DiscoveryIntensity); threshold commitments remain open. Closing this drift requires a future balance-pass wave to commit per-label intensity ranges. Status: OPEN for thresholds.

  • Feature placement formula and ownership. CLOSED by Wave R-4 (2026-05-10) for the algorithm rewrite and the host-system retirement. The additive ScoreCandidate (suitability * 2 - avoidance + noise / 2) was replaced by the multiplicative score formula authored in gd-feature-generation-contract.md "Placement Formula": score = hardGate * suitability * rarityModifier * seededNoise * spacingPenalty * storyBias. Static factors (hardGate, suitability, seededNoise, storyBias = 1.0 stub) are computed by Generated/Locations/FeaturePlacement/FeaturePlacementQuery.Evaluate; dynamic factors (rarityModifier = clamp(1 - used/budget, 0, 1), spacingPenalty = clamp(distance / minSpacing, 0, 1)) are applied by the new FeaturePlacementSelector static helper at selection time. FeatureFamily was expanded to 14 values matching the contract's family list; stub families (Water, Food, Forest, Travel, Shelter, Corruption, Nexus) carry no committed templates yet and read-model switches default-case to the Landmark / generic visual until templates land. AvoidanceWeights was folded into SuitabilityWeights as negated entries on every profile so each profile carries one self-consistent weight set; H.AvoidanceWeights was retired from the hash table and the field row was dropped from Generated/Declarations.cs. FeaturePlacementSystem was deleted and its logic moved to the static Generated/Locations/FeaturePlacement/FeaturePlacementSelector.cs, which MapGenerationSystem.Execute calls after CreateForcedFeatures so ordinary Features are placed in the Generated entry-point system, not in a Host-side ITickSystem. LocationFacts gained an IsWater field (1 = water, 0 = land) so the hardGate factor blocks Land-family Features from spawning on water Locations. Resolved by: Wave R-4. Status: CLOSED for the algorithm and ownership refactor.

  • Feature placement balance pass. The MinScore thresholds on each profile (130–165) were tuned for the additive formula's score distribution. Wave R-4 changed the formula scale to a fixed-point integer in [0, 1000], so the existing thresholds are now permissive rather than restrictive at the static-score gate. Profile budget values (MinPerWorld, MaxPerWorld, DensityDivisor, MinSpacingRank, etc.) are also untuned for the new formula's distribution. Closing this drift requires a future balance-pass wave to recommit threshold values against the multiplicative formula. Status: OPEN for thresholds.

  • Feature stub-family templates. Seven of the 14 Feature families expanded by Wave R-4 (Water, Food, Forest, Travel, Shelter, Corruption, Nexus) carry no committed templates today. The Nexus family is occupied semantically by DormantNexus but that template remains in the Story family pending the contract's Nexus-promotion decision; the other six families have no templates at all. Closing this drift requires future content waves to author templates per the example list in gd-feature-generation-contract.md "Feature Families". Status: OPEN.

  • FeatureSnapshot wire shape. The FeatureSnapshot projection surfaced to the React client does not yet expose the placement intensity, score, or family fields beyond what was committed before Wave R-3. Wave R-4 deliberately did not extend the wire surface (parity with R-2 / R-3 deferral). Closing this drift requires a future Server wave. Status: OPEN.

  • Planned terrain tags. 19 terrain-derived tags listed in gd-location-generation-contract.md "Derived Classes And Tags" are not yet committed to Content/common/tags.secs. See catalogs/tag-catalog.md "Planned Tags (Not Yet Committed)" section.