fix/cfe-silent-ok
safed7bc0c1 · incrementalpre-PRreviewed 2026-07-22 23:35 UTC0H · 1M · 1L · 1I- Purpose
- BAT-272: CFE collector silently returned success:true with zero bills on transient Mi Espacio registration failures, preventing SFN retry
- Goal
- Transient Mi Espacio registration failure throws RecoverableCollectionFailure (SFN retry) or grades failed/partial_success via run-level failure entry; genuinely-empty accounts still grade completed
- Sub-goals
- SG-1: Repair recoverable gate + decideMiEspacioFailureAction pure helper
- SG-2: Pin decideFinalizeJob grading with regression tests + document lever in cfe-pipeline.md
- SG-3: Add gobierno_fallback strategy label (failed Mi Espacio ≠ gobierno_only)
- SG-4: Preview e2e on manually-deployed cfe-silent estate (ALL PASS)
- SG-N: Framework fold-back — MAX_BRANCH_NAME_LEN 17→16 + 5 doc/skill/setup fixes
- What
- This incremental commit (SG-N final piece) corrects infra/cdk/CLAUDE.md to reflect that HelioScope's Lambda is now the longest CDK resource name (48-char fixed part), reducing the readable branch slug budget from 17 to 16 chars. Consistent with naming.ts update from earlier commits on this branch.
- Why
- The CLAUDE.md doc still referenced the old CFE resource as the longest name and budgeted 17 chars, which had silently become wrong after HelioScope landed — causing every preview-provision run on this branch to fail (17-char slug + 48-char fixed = 65 > 64).
- Areas
- infra/cdk+2−2services/utility/bills/cfe+333−14domains/utility/src/cfe-job+74−0packages/api/src/schemas+13−0.claude/rules+57−2.github/workflows+14−7CLAUDE.md+1−1
- Blast
- 7 areas, ~820 lines changed total; production change confined to services/utility/bills/cfe (Lambda collector). infra/cdk and framework/doc changes are non-production.
Findings · 3
correctness1
Math verified correct: 48 + 16 = 64
infra/cdk/CLAUDE.md
Fixed part `batu-…-dev-metrics-helioscope-materialize-persist` = 48 chars. 48 + 16 = 64 exactly matches the IAM/Lambda/EventBridge cap. naming.ts MAX_BRANCH_NAME_LEN = 16 is consistent. Historical note is accurate: slug `fix-cfe-silent-ok` = 17 chars → 17 + 48 = 65 → synth crash confirmed.
conventions1
Historical bug narrative is descriptive, not prescriptive
infra/cdk/CLAUDE.md:48
The parenthetical '(The constant sat stale at 17 after HelioScope landed; every 17-char-slug preview deploy crashed synth with a 65-char function name until BAT-272 SG-N fixed it.)' explains a past bug rather than defining how things should be built. CLAUDE.md Tier 3 rule: 'CLAUDE.md is prescriptive, not descriptive.' The equivalent history already lives in naming.ts JSDoc where it belongs.
improvement1
Re-derive instruction duplicates root CLAUDE.md
infra/cdk/CLAUDE.md:48
The 're-derive MAX_BRANCH_NAME_LEN when adding a resource with a longer fixed part' instruction already appears verbatim in the root CLAUDE.md. The local ref is useful context adjacent to the number but creates two places to keep in sync.