Skip to content

docs(architecture): ADR-0004 — engine anchor files as instructions spine#582

Merged
ChBrain merged 1 commit into
mainfrom
feat/adr-engine-anchor-entry
May 27, 2026
Merged

docs(architecture): ADR-0004 — engine anchor files as instructions spine#582
ChBrain merged 1 commit into
mainfrom
feat/adr-engine-anchor-entry

Conversation

@ChBrain

@ChBrain ChBrain commented May 27, 2026

Copy link
Copy Markdown
Owner

What

New ADR capturing the architectural pattern that emerged from #577 (gender anchor) and #581 (wow anchor): every engine domain subfolder has one anchor file, which is the entry point engine/stack/instructions.md plugs into.

Files

File Change
docs/architecture/adrs/0004-engine-anchor-as-instructions-entry.md NEW — the ADR
docs/architecture/README.md +1 line — adds ADR-0004 to the index table

The decision in one block

  1. One anchor per engine axis. Every engine/<axis>/ carries exactly one anchor file. The integration layer engine/stack/ is exempt.

  2. Two flavours:

    Flavour File pattern Shape When
    Position-anchor position_<axis>.md HOLD (Has/Orders/Loses/Drives) Axis is read on the persona — static
    Process-anchor process_<verb>_<axis>.md IDLE (Initiated by/Direction/Lever/Echo) Axis happens — dynamic
  3. Anchor enumerates expressions in prose (sibling links), so zip readers can navigate without the README (READMEs are excluded from shipped zips).

  4. instructions.md is the registry — every anchor declared with mode:

    Mode Trigger Today's engines
    global every persona language, stress, gender, wow
    per-khai-type a specific khai entity in scope group, org, adoption

Why this ADR

Until now the pattern was implicit. Three problems:

  1. Inconsistent anchoring — gender and wow lacked anchors until engine(gender): add anchor position above male + female expressions #577/engine(wow): add anchor position above job-family and education-level positions #581
  2. instructions.md drift — only 5 of 7 engines were declared
  3. Discovery inside zips — readers can't depend on READMEs (scripts/build_zips.py excludes them)

This ADR makes the contract explicit so future axes follow it by default.

What this PR does NOT do (Open follow-ups in the ADR)

Relationship to KAIHACKS

The pattern is khai-spine-level architecture, not Cultures-specific. This ADR documents the Cultures-side concrete instance; the KAIHACKS-side abstract spec is follow-up #4. Other khai projects building on the same spine inherit the same engine-entry contract.

Verification

  • Pre-commit gate green ✅
  • Matches the existing ADR template (Status / Date / Author / Context / Decision / Architecture / Alternatives / Consequences / Open follow-ups) ✅
  • ADR-0004 indexed in docs/architecture/README.md

Refs: #577, #581


Generated by Claude Code

…pine

Captures the pattern that emerged from PR #577 (gender anchor) and
PR #581 (wow anchor):

- Every engine domain subfolder has exactly one anchor file -- its
  single clear entry point.
- Two anchor flavours, picked by what the axis is:
    position-anchor (HOLD: Has/Orders/Loses/Drives) for axes the
                     room *reads* statically on the persona
    process-anchor  (IDLE: Initiated by/Direction/Lever/Echo) for
                     axes that *happen* dynamically
- The anchor enumerates its expressions in prose (with sibling
  links) so zip-deployed readers can navigate the axis without the
  README (engine READMEs are excluded from shipped zips by
  scripts/build_zips.py).
- engine/stack/instructions.md is the registry: every anchor is
  declared there with an invocation mode -- "global" (every persona,
  e.g. language, stress, gender, wow) or "per-khai-type" (when a
  specific khai entity is in scope, e.g. group, org, adoption).

Status: Proposed. The implementation work to update instructions.md
with the full engines registry is left as Open follow-up #1 -- this
ADR documents the contract; the registry update is a separate
culture/engine PR.

The pattern is architecture-relevant at the khai-spine level (a
KAIHACKS concern), not Cultures-specific. Open follow-up #4 calls
for mirroring the contract in KAIHACKS' ARCHITECTURE.md so other
khai projects inherit the same engine-entry pattern.

Files:
  docs/architecture/adrs/0004-engine-anchor-as-instructions-entry.md  NEW
  docs/architecture/README.md                                          +1 line
    (added ADR-0004 to the ADR index table)

Refs: #577 (gender precedent), #581 (wow precedent), engine/org/
      process_operate_org.md (existing process-anchor convention).
@ChBrain
ChBrain merged commit 5255710 into main May 27, 2026
53 checks passed
@ChBrain
ChBrain deleted the feat/adr-engine-anchor-entry branch May 27, 2026 14:11
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