Append-only log of decisions made when the guide is silent or ambiguous. Each entry: date, sub-phase, decision, one-line rationale.
SdkErroris a class union, not a literal-tag union. The guide example shows a discriminated union on akindliteral. This codebase already discriminates oncode: ErrorCodeplusinstanceofchecks against named subclasses; using class union preserves that pattern. Adding a newkindfield would require changing every existing subclass's wire shape.- Catch-block
causeaudit deferred to post-2.5. Auditing catch sites in files that 2.5 will split is wasted work; the audit will be straightforward once files settle. - Snapshot is not updated to reflect the additive
SdkError. The prompt explicitly says "Update the snapshot only with explicit user approval recorded in DECISIONS.md." Additive drift is allowed and recorded in commit messages; the snapshot remains the Phase-1 frozen baseline. The .d.ts diff at sub-phase 2.9 will show only this one additive entry, which is fine.
- Pre-commit hook runs
lint:biomeonly, notlint. Sub-phase 2.1 enables strict ESLint complexity rules that will be red until 2.5. Running the fullpnpm lintin pre-commit would block every intermediate refactor commit.lint:biomeprovides fast obvious-mistake protection; full ESLint runs in CI (advisory during 2.5) and is required for the final Phase 3 gate. - CI
Lint (eslint)andCyclesmarkedcontinue-on-error. Same reasoning. The publish workflow downstream depends on the test workflow's overall success, which would otherwise fail. These will be flipped back to required at the end of sub-phase 2.5. madge --exclude '(dist|node_modules)'. Without the exclusion, madge double-counted cycles via dist.d.tsfiles that mirror the src cycles. Excluding gives a clean signal: 6 real cycles in@arcp/runtime.tsd/expectTypeOfsetup deferred to 2.7. The public generic surface is small enough that adding type tests can live with the documentation pass rather than gate sub-phase 2.1.useUnknownInCatchVariables: truewas safe to enable. No typecheck errors surfaced because catch blocks were already written defensively (noerr.fooaccess without narrowing).
- Recovered stashed WIP onto
refactor/automationas one commit. The user's WIP turned out to be the start of sub-phase 2.5 forserver.ts. Better to integrate it on the refactor branch than to refactor in parallel and conflict-resolve later. Single commit8227bdacaptures the recovery. - Removed two unused-constant artefacts of the WIP extraction.
DEFAULT_IDEMPOTENCY_TTL_MSandDEFAULT_MAX_CONCURRENT_JOBSwere left inserver.tsafter their consumers moved tojob-runner.ts. Deleting them is the trivial completion of the half-done extraction, in scope for "recover the WIP cleanly," and required for the lint hook to pass. - Dropped the stash entry after the recovery commit. The WIP is now on a branch and in git history; the stash is redundant.
- WIP handling: stash, not commit. Stashed dirty runtime work
(server.ts modification + 3 untracked files) instead of committing
it to
mainor branching from a dirty tree. Reason: stashes are reversible and don't pollute history; the user can recover the WIP withgit stash popor cherry-pick selectively after refactor. - Refactor branch base: clean
main. Branchedrefactor/automationfrom cleanmain(326dd2b) after the stash. Reason: the refactor needs a stable base to diff against; a dirty base would conflate refactor changes with WIP. - Snapshot subpath barrels too, not just
index.ts. Saved.d.tsfor every export-map subpath (e.g.@arcp/core/envelope,@arcp/sdk/client), not just the package roots. Reason: the codebase deliberately uses subpath exports; the public surface contract includes them, so the Phase-1 snapshot must cover them for an honest later diff. biomeignore for.refactor/. Added"!.refactor"tobiome.jsonfiles.includes. Reason: the refactor state directory contains.d.tsreference files (inapi-snapshot/) that biome would lint as source. ESLint already ignores**/*.d.tsso no eslint change was needed.- Function-level violations deferred until sub-phase 2.1. The Phase-1 inventory does not enumerate functions exceeding 40 lines / complexity 10 / 3 params individually — heuristic awk scans were unreliable. Decision: enable the ESLint rules in sub-phase 2.1 and let lint output be the authoritative violation list for sub-phase 2.5.