feat(scaffolding): Construction Pattern core — evidence-backed applicability, filtered obligation derivation, process guards (SCAFFOLD-TRANCHE-006)
Also §0 pre-flight: SCAFFOLD-TRANCHE-005 found approved/open (parent-
lifecycle neglect — child closed, parent forgotten); closed with real
existing evidence only, provenance recorded, process-defect entity added.
- construction_pattern.py: open-world ConstructionPattern (signals,
obligations with when-conditions, provenance, revision + history,
maturity, ext); evaluate_applicability — deterministic signal groups,
verdicts APPLIES/PARTIAL/DOES_NOT_APPLY/UNKNOWN, name similarity
establishes nothing, project exclusions override, model proposals stay
PENDING; derive_pattern_obligations — obligations FILTERED by project
evidence (REQUIRED/APPLICABLE/NOT_APPLICABLE/UNKNOWN + EXCEPTED with
provenance retained, §18); combine_pattern_obligations — dedupe with
also_from, conflicts surfaced never silently resolved (§26-27);
authority boundary: pattern = guidance, project evidence wins (§3)
- construction_patterns_builtin.py: 4 evidence-grounded patterns, all
appropriately immature (§15):
* capability-module-adaptation (UNIT-PROVEN; build-but-don't-break;
provenance T1/T3/T4 contracts)
* release-deployment-change (UNIT-PROVEN; 9 obligations incl.
fail-closed qualification, exact identity, staging!=promotion,
promotion truthfulness, monotonic ordering, negative+forward proofs,
deployed-identity verification; provenance deploy-order-race
incident + DEPLOY-MONOTONIC-001 + red-promotion incidents)
* ui-tui-structural-change (UNIT-PROVEN; layout inheritance, USER-LOCKED
preservation, UNKNOWN-never-PASS; provenance issue-105 + T3 real proof)
* store-schema-evolution (CANDIDATE; backward readability, roundtrip,
authority preservation, migration-only-if-needed; provenance T2/T4/T5)
- make_decision integration: APPLIES+PARTIAL patterns consulted (§7 —
per-obligation when-conditions do the precision work); provenance
PATTERN distinct from STRUCTURAL derivations (§8); pattern refs +
revisions carried into generated contracts (§17/§19)
- construction_guards.py + Scaffold.save_verified/verify_on_disk (§21-22):
Guard A durable-mutation readback — verify_on_disk is the pure no-write
readback that catches the forgotten-save lie (T5 defect class A);
Guard B source-edit postcondition — zero-match is a truthful no-op
(EditNoOp), expected-count + postcondition enforced (T5 defect class B)
- REAL PROOFS: §23 read-only replay of DEPLOY-MONOTONIC-001 Need —
release pattern APPLIES on evidence, 9 obligations derived WITHOUT the
Need listing them (negative/forward/monotonic/deployed-identity all
pattern-derived, provenance carried); resolution COMPOSE matches the
original repair; §24 live change save_verified/verify_on_disk — the
store pattern contributed store-roundtrip, an obligation the raw Need
did not state; §25 held-out — webhook-config-only deploy change does
NOT demand promotion rework but keeps release regression verification
Tests: 30 new (§28-§32 plans + held-out + live); suite 1556 green;
henxels rc=0; pyright clean.