Code Generation Decisions (CGD)

Owner decisions that settle conflicts between vault notes, the A7 Governance Delta v1, the skeleton build plan (2026-10-01), and the Gemini vault-architecture proposal. Rules in Rules cite these IDs in their decisions field. A decision changes only through a new row here, never by editing a rule alone.

Conflicts between vault sources

IDQuestionDecisionWhy
CGD-01TypeScript moduleResolutionNodeNext for code Node runs or publishes (A4, A7, A8, A14 TypeScript repos, A17). bundler for code a bundler always processes (A9, A10, A11, A12, A20, A22).Published libraries must resolve in raw Node ESM; apps keep extensionless imports.
CGD-02ESLint config formatFlat eslint.config.js only. No .eslintrc.*.ESLint 9 defaults to flat config; .eslintrc is removed in ESLint 10.
CGD-03A7 library outputESM-only, built with tsc. No CJS build, no tsup.Consumers are ESM; Node 22.12+ can require() ESM; avoids the dual-package hazard and a build tool.
CGD-04Test layoutAgent-written tests in tests/unit/, mirroring src/. Owner-authored acceptance tests in protected tests/acceptance/.Matches the A7 Delta scan scopes (BP-05, BP-10) and protected paths without gate changes.
CGD-18Package managernpm. Lockfile package-lock.json, install with npm ci --ignore-scripts.Matches the A7 Delta checker, fixtures and rollout commands; ships with Node.
CGD-19Node versionengines.node is >=22.12. CI tests Node 22 and 24. Raise the floor when Node 22 reaches end of life (April 2027).Oldest supported Node line; has unflagged require(esm), which CGD-03 relies on.

Code conventions

IDQuestionDecisionWhy
CGD-05Error handling at the APIReturn Result<T, E> for expected failures a caller handles with ordinary input (parse, validate, lookup miss). Throw a named Error subclass for contract violations (caller bugs).Expected failures become visible in types; caller bugs stay loud.
CGD-06Where Result livesEach library defines the canonical Result in src/result.ts and exports it as a type. The text is fixed by rule STD-TS-007 (see index).Zero runtime dependencies (A7); structural typing makes copies interchangeable.

Vault architecture

IDQuestionDecisionWhy
CGD-07Where rules liveobsidian/rules/, normative rules only. references/ stays descriptive and is never injected into agent context.The resolver scans one directory; guidance and mandates stay separate.
CGD-08Rules without a mechanical checkAllowed with severity ADVISORY and a review enforcement (stage S2). Never described as gated.Matches the A7 Delta: instruction-only boundaries are advisory and say so.
CGD-09Resolver and pinningThe resolver lives in ops-core. Task files pin vault_commit; the task field naming rule IDs is rules, not standards_basis. Evidence records context.json.Reproducible context; standards_basis already means external standards.
CGD-10Synced pattern stubsops-core sync emits status: stub and stops writing # noqa: E501. A pattern becomes status: canonical only when it holds real code. Rules link canonical patterns only.250 of 279 pattern notes have no code.
CGD-17Heading orderRemove the empty ## Overview line that precedes the H1 in existing notes. Rule files allow H1 to H3 only.Heading-based chunkers and outlines break when H2 precedes H1.

A7 Governance Delta v1 owner decisions

These change files in the A7 repository or ops-core, not this vault. They are inputs to the owner-authored governance/delta-v1 PR.

IDDelta questionDecision
CGD-11BP-06 severityWARN until the false-positive rate is measured over roughly 10 tasks; promote to BLOCK by governance PR.
CGD-12risk-paths.jsonShip a minimal list now: .github/workflows/**, package.json, package-lock.json. Minimum risk values follow the task-file risk scale, still to be defined.
CGD-13BP-02 caseUppercase markers stay BLOCK. Add BP-02W (WARN): lowercase todo, fixme, xxx, hack inside comments only.
CGD-14Repair limitTwo repair cycles per finding ID; a third occurrence stops the task. Recalibrate after roughly 10 tasks.
CGD-15Tier 1 (ESC-GATE-TAMPER)Preserve the branch for review, then always re-dispatch the task from a clean base in a fresh worktree. The old branch is never merged.

Repository housekeeping

IDDecision
CGD-16Rebuild the empty git index from HEAD (done 2026-10-02). Rules work happens on branch rules/a7-v1, separate from expansion/supernova-update.