Skip to content

v1.5.0: Project-Scale Extract Design — whole-project extraction + design-mode hardening - #32

Merged
kostua16 merged 61 commits into
mainfrom
worktree-ver1.5.0
Jul 23, 2026
Merged

v1.5.0: Project-Scale Extract Design — whole-project extraction + design-mode hardening#32
kostua16 merged 61 commits into
mainfrom
worktree-ver1.5.0

Conversation

@kostua16

Copy link
Copy Markdown
Owner

Summary

Ships milestone v1.5.0 — Project-Scale Extract Design. Turns the v1.4.5 extract flow into trustworthy whole-project extraction — one /feature-workflows:extract-design command processes an entire large project through bounded, durable, resumable per-feature segments — and extends the same durability / truthfulness / bounded-execution contracts to /feature-workflows:design-feature and the shared engine. Command surface unchanged (still 8 commands, 31 agents).

What's in this PR

  • 11 phases (1–7 extract-orchestration core + 8–11 design-mode extension) + a post-audit tech-debt cleanup. 36/36 requirements delivered.
  • New engine primitives in plugins/feature-workflows/workflows/src/: lifecycle/migration/revision reducers; bounded discovery + validated graph + schedulability; multi-entry generated dist + version lockstep; checkpointed feature leaf (fp-extract-slice); bounded scheduler + transactional continuation; synthesis + truthful status; plus design-mode durable checkpoints + auto-recovery, truthful designReady, enforced per-gate/per-loop budgets + bounded prompts, transient-error backoff, and deterministic digest-based artifact verification.
  • Docs/ledger: README refreshed for v1.5.0; GSD milestone archived to .planning/milestones/v1.5.0-*.md; retrospective + onboarding summary; Serena project memories.
  • GitHub: parent issue v1.5.0 Project-Scale Extract Design #19 + phase sub-issues Phase 1: State, Coverage, Migration, and Revision Contracts #20Phase 11: Design-Mode Reliability, Verification, and Characterization Proof #30 all closed.

Quality

  • 1470 tests passing, generated dist verified drift-free against a clean source compile.
  • Nyquist validation (per-phase gap-fill) caught 8 real defects — all fixed: dead overlap-detection in validateGraph; coverage-index camelCase/hyphen mismatch; CONTINUUATION_ACK typo; feature-removal rebuild skip; unitType loss on retry; digest computed from path-string not content; loose non-object guard; shallow-copy budget-summary mutation.
  • UAT verification (goal-backward, per-phase) caught a 9th: DBUDGET-01 was implemented as pure functions but never wired into the live design flow — now wired via designBudgetGate at all 12 design gates.
  • Milestone audit: passed (integration PASS, 35/35 E2E rows backed).

Notable decisions / deferred

  • The Phase-2 deterministic primitives (inventory/discovery/graph/queue/schedulability) are characterization libraries only — the runtime extract path uses an LLM subsystem-decomposer by design (02-PLAN.md). Runtime determinism was not a hard requirement.
  • Token-budget characterization numbers are not measured (measurement plumbing added; needs a dogfood run).
  • v1.5.0 tag created locally only (not pushed); plugin.json/marketplace still pinned at 1.4.5 — release/pin is a separate step.

Stats

60 commits · 165 files (+39,921 / −1,044) · 2026-07-22 → 2026-07-23. Branch is 0 commits behind main (no merge conflicts).

kostua16 added 30 commits July 22, 2026 14:24
Drop the <example>/<commentary> blocks from each agent's description field; they restated the headline trigger verbatim. Headlines and all distinctive routing details are preserved, so subagent selection is unchanged. Cuts per-turn description overhead ~60-75% across 31 agents. Agent instruction bodies are untouched.
…ctive revision invalidation

Add three pure-function source modules implementing CONTRACT-01, STATE-01, REV-01:

- lifecycle.mjs: explicit 8-state lifecycle enum, 3 skip-reason classifications,
  pure transition reducer with illegal-transition rejection, readiness derivation
  that separates feature-level/policy-disabled/required-gate skip semantics
- migration.mjs: root-last v1.4.5 to v1.5.0 state migration with deterministic
  feature identity derivation, idempotent transform, and fault-injection boundary
  validation (children durable before root acknowledgement)
- revision.mjs: djb2 digest computation, revision comparison with gate-dependency
  map, selective invalidation targeting only affected gates, independent evidence
  retention

Wire new modules into build pipeline and test harness. Add 79 characterization
tests covering all Phase 1 RED/GREEN evidence requirements. All 262 tests pass.
Add five pure-function modules implementing INV-01, DISC-01, GRAPH-01,
QUEUE-01, DEPCTX-01:

- inventory.mjs: deterministic path classification and inventory digest
- discovery.mjs: paginated cursor-based discovery with stale-aware resume
- graph-validation.mjs: collision/ownership/cycle validation with policy support
- queue-semantics.mjs: cap/selector/promotion with exactly-one-state guarantee
- schedulability.mjs: prerequisite waves and bounded dependency context

113 new tests (375 total, all passing). Build produces 24-module dist
with no drift. All 262 existing tests remain green.
Add fp-extract-slice.js as the second generated workflow entry alongside
feature-pipeline.js. Both entries share version metadata from plugin.json,
are validated for drift in lockstep, and resolve through copy and symlink
install paths.

Source:
- src/meta/fp-extract-slice.meta.mjs: minimal 2-phase leaf meta
- src/extract-slice-entry.mjs: leaf entry point (extractSliceMain)

Build:
- build-workflows.mjs: per-entry tail config, second ENTRIES element
- Leaf excludes main.mjs (all phase() calls outside extract-slice.mjs
  live in main.mjs; dead main import binding never called at runtime)

Validation:
- validate-plugin-versions.mjs: checks both dist files' headers and
  meta.version against plugin.json

Tests: 22 new tests in multi-entry-build.test.mjs (397 total, all passing)
…tence

ORCH-01: Top-level orchestrator now spawns fp-extract-slice via Workflow()
for multi-slice runs with direct-call fallback for single-slice/test harness.

CHECKPOINT-01: Added checkpointSlice() that durably persists slice state after
each material gate via flushPipelineState. 7 checkpoint calls cover all
material gates (facts, e2e, design, arch, review, requirements, audit).

Lifecycle reducer integration: leaf entry transitions features through
applyLifecycleEvent (runnable -> in-progress -> completed/blocked/failed).

24 new tests (421 total). All continuous regression gates pass.

Requirements ORCH-01, CHECKPOINT-01 complete.
…tion

Add budget admission with non-spendable reserve (BUDGET-01), bounded retry
with persistent attempt history (RETRY-01), failure isolation preserving
independent work (ISOLATE-01), and transactional automatic continuation with
monotonic segment IDs and idempotency keys (CONT-01).

New modules:
- budget-admission.mjs: characterized limits, accountant, reserve, admission
- retry-policy.mjs: per-gate/per-feature limits, monotonic attempt journal
- failure-isolation.mjs: shard-level isolation, transitive dependency propagation
- continuation.mjs: monotonic segments, intent-acknowledge lifecycle, convergence

Main.mjs integration: budget admission check, attempt recording, failure
isolation, segment tracking, and continuation summary in the extract loop.

Build: 28 modules per entry (was 24), 261 top-level names (was 222).
Tests: 68 new (489 total), zero regressions.
Add incremental synthesis with selective revision invalidation (SYNTH-01),
attempted-vs-durable persistence tracking (OBSERVE-01), and truthful readiness
derivation with immutable status projection (STATUS-01).

New modules:
- synthesis.mjs: system overview, dependency map, cross-cutting concerns,
  coverage index derived idempotently from verified feature summaries
- observe-persist.mjs: ATTEMPTED/DURABLY_VERIFIED/FAILED write lifecycle
  with retry-safe duplicate prevention
- status-truth.mjs: comprehensive readiness checks (discovery, graph,
  features, synthesis, artifacts) and frozen projection shared by handoff
  and read-only status

Integration: extract loop synthesizes views after slice completion, tracks
persistence at all consolidate boundaries, and derives truthful extractReady
replacing the unconditional flag.

Tests: 55 new (544 total), zero regressions.
Phase 7 COMPAT-01 + QUAL-01 + DOGFOOD-01:

- 42 compatibility regression tests proving design/implement/tune/review/status
  hydrate v1.4.5 and v1.5 state safely with no extract leakage
- 27 E2E matrix tests covering all 18 Phase 1-6 scenarios against clean build
  and both copy/symlink install modes
- 11 dogfood scale tests: 120-feature whole-repository extraction across 3
  segments, interruption recovery, duplicate continuation convergence, and
  truthful readiness with synthesis + coverage

624 tests total (544 existing + 80 new), zero regressions.
DCKPT-01: checkpointDesign helper flushes state via flushPipelineStateWithSnapshot
after all 19 material gates (15 design + 4 implement). Tune mode already
consolidates at every checkpoint so no additional checkpoints needed.

DSTATE-01: flushPipelineStateWithSnapshot retains last-good snapshot before
each write. loadPipelineStateWithRecovery auto-recovers from
pipeline-state.last-good.json when the primary file is truncated/corrupt,
replacing the resume-invalid-state hard-block.

DRESUME-01: repairResumeArtifactFlags skips the expensive LLM
verifyArtifactPresence call for artifacts with a durably acknowledged
checkpoint and matching content digest (Phase 1 computeContentDigest).

22 new tests (646 total). All continuous regression gates green.
designReady=true now gated by deriveDesignReadiness pure function checking
fail-forwarded reviews, force-accepted plan blockers, and unresolved reconcile
conflicts. Degradation events journaled durably via recordDegradationEvent.
Commit failure blocks instead of overstating success. Open questions,
chunker degradation, and YAGNI blockers explicitly surfaced.

DREADY-01: deriveDesignReadiness + DESIGN_READINESS_REASONS pure gate
DHIST-01: recordDegradationEvent + degradationLogSummary journal
DTERM-01: commit-failed blocks, _publishVerified/_persistVerified
DQUEST-01: unresolved open questions block completion
DCHUNK-01: chunker degradation surfaced in handoff
DYAGNI-01: BLOCKER findings reach reviewer regardless of reconcile flag

54 new tests (700 total), all passing.
…prompts

DBUDGET-01: design-budget.mjs wraps Phase 5 budget-admission pattern with
per-gate/per-run call/token enforcement and non-spendable HANDOFF reserve.

DLOOP-01: design-loops.mjs gives each review/refine loop (refine, reconcile,
debug, escalation) its own bounded sub-budget so early-loop spend cannot starve
later loops. ESCALATION_RETRIES now configurable via args.maxEscalationRetries.

DPROMPT-01: all design-gate prompt interpolation sites now use compactList
instead of raw JSON.stringify — reconcile conflicts, design fixes, review
blockers, YAGNI blockers, and review-loop failureContext.

32 new tests (732 total).
… characterization tests

DTRANS-01: classifyAgentError + retryTransientError with bounded backoff
(3 retries, 500ms base) in flexibleAgent catch block. Transient errors
(network/provider) retried before hard-blocking.

DVERIFY-01: verifyArtifactDigest pure function checks durable checkpoint
+ digest before trusting LLM self-report. verifyArtifactPresence skips
LLM call when digest-verified. verifyAppendGrowth uses content digest
comparison when available.

DTEST-01: 55 new behavioral characterization tests covering error
classification, digest verification, append-growth, gate sequence,
retry ladder, crash-resume, and regression assertions for phases 8-10.

787 total tests (732 + 55), all passing. Build drift-free.
…ts passing

Milestone v1.5.0 is now complete with all 11 phases successfully executed and verified. The project achieved 787 passing tests, confirming the reliability and correctness of the design. Key updates include the successful implementation of design-mode reliability, verification, and characterization proof in Phase 11. Next steps involve archiving this milestone and preparing for the next version.
49 new tests covering 7 gaps identified by Nyquist audit:
- STATE-01: bounded root state contract (3 tests)
- CONTRACT-01: input validation edge cases (5 tests)
- CONTRACT-01: TRANSITION_TABLE completeness (3 tests)
- CONTRACT-01: migration legacy status completeness (5 tests)
- CONTRACT-01: deriveReadiness mixed-state comprehensive (3 tests)
- CONTRACT-01: resume convergence after partial migration (1 test)
- CONTRACT-01: boundary validation edge cases (4 tests)
- REV-01: combined multi-input revision changes (4 tests)
- REV-01: nested object/array digest stability (5 tests)
- REV-01: gate dependency map completeness (2 tests)
- E2E-STATE-01: full boundary lifecycle (1 test)
- E2E-REV-01: independent input + new/removed artifact (3 tests)
- isIncomplete edge cases (2 tests)

Total: 836 pass / 0 fail (787 original + 49 validation)
7 gaps audited and filled: STATE-01 bounded root state contract,
CONTRACT-01 input/migration/readiness edge cases, REV-01 combined
revision changes and nested digest stability. All 3 requirements now
nyquist_compliant with automated verification.
…8 gaps

Validation surfaced a real defect: validateGraph overlap check was unreachable dead code (Object.entries(ownershipMap) never yields duplicate keys). Rewrote to build a pathClaims map from features' paths arrays — unexplained overlap now errors, explained overlap warns. +46 Nyquist gap-fill tests across INV-01/GRAPH-01/QUEUE-01/DEPCTX-01 and 2 E2E flows. Suite: 883 pass, 0 fail. nyquist_compliant for Phase 2.
…uild

Close 7 validation gaps identified by retroactive gsd-validate-phase audit:
- extractSliceMain behavioral coverage (arg parsing, missing-slice, JSON coercion)
- extractSliceMain lifecycle init/preservation and return shape
- extractSliceMain source assertions (done→complete, try/catch, imports)
- Leaf meta source verification (2 phases, dev version, name, description)
- Build script structural invariants (module-set relationship, equal count)
- Version validator failure paths (N-surface, exit-1, entry count)
- Phase subset invariant and entry independence (distinct names/tails/descriptions)

31 new validation tests. Total: 914 pass / 0 fail.
VALIDATION.md documents the per-phase validation contract, requirement coverage,
gap analysis audit (7 gaps found and filled), and sign-off for Phase 3.
…NT-01

Behavioral resume tests (gate-skip-on-resume), per-gate blocked return
values, audit gate checkpoint, artifact key mapping completeness (7 gates),
checkpoint state survival on resume, leaf no-composition proof (source +
dist), leaf no-readiness/scheduling authority, Workflow spawn guard
conditions, duplicate completion terminal + convergence.

45 new tests (959 total, 0 failures).
…1, RETRY-01, ISOLATE-01, CONT-01

Audit found 12 validation gaps in Phase 5's test coverage:
- BUDGET-01: token-ceiling rejection, token-dimension canFinishNextGate,
  setReserve overwrite, exhaustion boundary, budgetSummary completeness
- RETRY-01: zero-attempt edge cases, cross-feature isolation,
  over-limit boundary, success-does-not-count
- ISOLATE-01: timeout/resumable classification, transitive chain depth>2,
  eligibleIndependents status filtering, segmentOutcome conventions
- CONT-01: canAutoRelaunch boundary (2v3), multi-gap out-of-order,
  empty-state convergence, null-revision key, sorted feature storage

All 1008 tests pass (959 existing + 49 new). Build drift clean.
Fix deriveCoverageIndex lifecycle key (inProgress → 'in-progress'),
CONTINUUATION_ACK typo, feature-removal rebuild detection, and
unitType preservation on retry. Add 75 edge-case tests covering
error paths, default fallbacks, structural constants, and lifecycle
chains across SYNTH-01, OBSERVE-01, STATUS-01.
…01, QUAL-01, DOGFOOD-01

Fill validation gaps across all three Phase 7 requirements:
- COMPAT-01: resolveMode/gateModeActive/validatePipelineState/migrateLegacyState/
  validateMigrationBoundary/deriveFeatureId/detectResumeEngineSkew edge cases
  (null/undefined/invalid/degenerate inputs, throw paths, structural assertions)
- QUAL-01: classifyPath (generated/third-party/ignored/null/empty), graph ownership
  overlap + cycle detection, continuation out-of-order/lost-ack convergence,
  failure isolation semantics (timeout/blocked/error terminal), extractReadiness
  false-paths (all 6 independent failure conditions), countLifecycleStates
- DOGFOOD-01: shouldContinue/canAutoRelaunch/resumeCommand/continuationSummary,
  isTerminalFailure (permanent/blocked/retryable/exhausted), segmentOutcome,
  budget admission boundaries, 200-feature irregular-cap exact-once

1203 total tests (1083 pre-validation + 120 new), zero regressions.
… derivation

Audit Phase 8 (DCKPT-01, DSTATE-01, DRESUME-01) for Nyquist validation
gaps and fill them with 68 new tests covering:

DCKPT-01: gate-list completeness (15 design + 4 implement gates),
gates without artifact path keys, ARTIFACT_CHECKPOINT_GATE_MAP coverage,
checkpointDesign structural semantics, non-blocking flush verification.

DSTATE-01: write ordering (snapshot before new state), first-write
behavior, recovery signal propagation, validatePipelineState corruption
patterns, resume path source wiring.

DRESUME-01: checkpoint-without-digest and digest-without-checkpoint
edge cases, mixed-state multi-artifact scenarios, planned-gate exclusion,
downstream flag cleanup, null/empty result handling.

Continuous regression: no FS/shell/forbidden tokens in Phase 8 code,
dist exports, harness availability.

Fix: checkpointDesign derived dataKey as _definition from definitionPath
but the actual result field is _define. Digest was computed from the path
string instead of the definition content. Fixed with explicit mapping.

Validation artifact: 08-VALIDATION.md with full gap analysis.
Full suite: 1271 pass / 0 fail.
kostua16 added 25 commits July 22, 2026 23:17
… lockstep

Goal-backward UAT verification for Phase 3 (DIST-01). Confirms the codebase
delivers exactly two supported workflow entries (feature-pipeline.js +
fp-extract-slice.js), drift-free clean rebuild, copy and symlink install
resolution, and N-surface version lockstep validated by live behavioral checks.
53 Phase 3 tests pass; full milestone suite 1448/0; no defects found.

Verdict: GOAL MET.
Goal-backward UAT verification of Phase 4 (ORCH-01, CHECKPOINT-01).
Verified: per-gate durable checkpointing at all 7 material gates, leaf
no-composition invariant, Workflow() spawn guard with fallback, shared
lifecycle reducer integration, resume at first incomplete gate, skip
semantics. 74 Phase 4 tests pass; 1448 total pass / 0 fail; drift-free.
…als MET

Goal-backward UAT verification for Phase 6 (SYNTH-01, OBSERVE-01, STATUS-01).
All 4 Nyquist defects confirmed fixed in post-fix code. 35 live behavioral
assertions pass against dist functions. 128 Phase 6 tests pass; 1448 total
pass / 0 fail. Build drift-free.
…l MET

Goal-backward UAT verification of Phase 8 (DCKPT-01, DSTATE-01, DRESUME-01).
All three requirements verified MET in post-fix codebase:
- 19 checkpointDesign call sites (15 design + 4 implement gates)
- flushPipelineStateWithSnapshot + loadPipelineStateWithRecovery wired to resume path
- repairResumeArtifactFlags digest-driven skip for unchanged artifacts
- Nyquist dataKey defect (definitionPath → _define) confirmed fixed
- 90 Phase 8 tests pass, 1448 full suite pass, build drift-free
…rting

Goal-backward UAT verification of Phase 9 (DREADY-01, DHIST-01, DTERM-01,
DQUEST-01, DCHUNK-01, DYAGNI-01). All 6 requirements verified MET through
source-code analysis, dist sync confirmation, and 141 Phase 9 tests passing
(54 design-truth + 87 nyquist-validation). Full suite 1448 pass / 0 fail.
Build drift-free. No new defects found.
…text

Fix: wire spendDesignGate/canAdmitDesignGate into all 12 design gates via
designBudgetGate helper (DBUDGET-01 was imported but never called in live path).

Add 10 NYQ-ENFORCE source-assertion tests protecting enforcement wiring.
Full suite: 1458 pass / 0 fail. Build drift-free.
Goal-backward UAT for Phase 11 (DTRANS-01, DVERIFY-01, DTEST-01).
All three requirements genuinely delivered: transient-error backoff,
deterministic artifact verification, 96 characterization tests.
1458 tests pass / 0 fail. Build drift-free. No defects found.
…n and defect fixes

Enhanced milestone v1.5.0 documentation to reflect UAT verification and validation outcomes. Notable updates include the addition of UAT verification results, confirmation of 8 defects fixed during validation, and a summary of gap-filling tests. The milestone is now marked as UAT-verified, with all phases meeting their goals. The document also clarifies the status of the release process and notes for future sessions.
Human-friendly onboarding summary: overview, architecture decisions, 11 phases, 36/36 requirements (all UAT-verified GOAL MET), quality evidence (9 defects caught/fixed across validation + UAT), tech debt, and getting-started guide. Flagged stale REQUIREMENTS.md status ledger as doc-debt.
Revised project state to reflect completion of Phase 10 and readiness for Phase 11 planning. Updated last activity details and adjusted progress metrics, indicating 9 completed phases and plans, with an overall completion percentage of 82%. Enhanced last session timestamp for accuracy.
…n PASS)

Aggregated 11 VERIFICATIONs + integration check + 3-source requirements cross-reference + Nyquist scan. All 36 requirements satisfied, 11/11 phases GOAL MET, 35/35 E2E rows backed, Nyquist COMPLIANT, 1458 tests green. Two design-intentional WARNINGs flagged for confirmation: P2 deterministic primitives have no runtime consumers (confirm runtime-determinism intent), and v1.4.5 migration not auto-invoked on resume. Tech debt: stale REQUIREMENTS ledger, missing P9/P10 SUMMARYs, missing requirements-completed frontmatter, plus non-blocking code observations.
…Complete

Per-phase UAT VERIFICATION confirmed all 36 requirements GOAL MET; the inline-execution sub-agents had updated STATE.md but not the requirement checkboxes. Flipped 23 stale [ ]→[x] and 20 traceability Pending→Complete. Status line now reflects completion.
P9 (recovered from API timeout) and P10 execution agents did not write SUMMARY.md; created both in the standard prose format covering DREADY/DHIST/DTERM/DQUEST/DCHUNK/DYAGNI (P9) and DBUDGET/DLOOP/DPROMPT + the UAT-wired designBudgetGate (P10). Restores complete per-phase artifacts and the 11/11 phase count.
Backfill machine-readable requirements-completed YAML frontmatter for
the 3-source cross-reference (source C was empty everywhere per audit).
Preserves existing prose Requirements lines.
…ration

Item B: validateMigrationBoundary docstring claimed 'Pure: without performing
any writes' but the function mutates child._durable in-place as an internal
accumulator. Corrected to describe the accumulator semantics accurately.

Item C (INT-MIGRATION-RESUME): add migrateResumeState() to migration.mjs and
wire an explicit --migrate flag into the resume path (main.mjs). A v1.4.5 state
file with result.slices can now be migrated to v1.5.0 format before validation,
avoiding a hard resume-invalid-state block. Opt-in flag avoids misfire-prone
auto-detection on every resume. 7 characterization tests added.
D1 (call counting): documented that designBudgetGate counts 1 call per gate
invocation (conservative). Instrumenting actual intra-gate agent calls would
risk regressions on verified code for marginal precision gain.

D2 (two budget systems): added code comments explaining Phase-5 retryState and
Phase-10 designBudget coexist by design (different modes, no ceiling approached).
Unification is YAGNI without proven need.

D3 (token budgets): added recordGateTokenSpend() and gateTokensRemaining() to
design-budget.mjs as the measurement plumbing for future per-gate token
characterization. Real characterization requires a dogfood run. 5 tests added.
Post-audit cleanup resolved all open items: P2 confirmed design-intentional, --migrate resume path wired, ledger reconciled, P9/P10 SUMMARYs + requirements-completed frontmatter added, migration docstring fixed, budget trade-offs documented + token plumbing. 1470 tests green, drift-free. Remaining: token characterization numbers (need dogfood run) + release tag.
Archived ROADMAP/REQUIREMENTS/AUDIT to .planning/milestones/v1.5.0-*.md; collapsed ROADMAP to milestone grouping; evolved PROJECT.md (shipped status, requirements→Validated, footer); added RETROSPECTIVE.md; fixed MILESTONES.md accomplishments; updated STATE.md focus. REQUIREMENTS.md preserved in .planning/ per instruction (also archived). 36/36 reqs met, 1470 tests, audit passed.
…traction, npm scripts

Updated the v1.4.5-era README: added a 'What is new in v1.5.0' section (whole-project bounded/durable extraction, truthful status, design-mode hardening, --migrate); corrected the 'No manifest' invariant (a package.json with compile/test/drift-check scripts now exists) and the engine-editing flow (edit src/, regenerate the dist via npm, do not hand-edit it); refreshed the extract-design blurb and the repo map (src/, leaf entry, compile script, tests, package.json, .planning/).
…atting

Removed outdated language server documentation and added a new section for language servers to start with the LSP backend. Adjusted the activation command timeout to a float value and ensured proper YAML formatting for workspace folder paths. This update streamlines the configuration and enhances clarity for users.
Five complementary memories (cross-reference existing core/handoff/session_start/suggested_commands):
- v1.5.0-summary: milestone scope, capabilities, quality, deferred items, records.
- workflows-overview: the one engine / six modes / eight commands / two entries / install model.
- agents-overview: the 31 sub-agents grouped by function.
- src-to-dist-mapping: how workflows/src compiles into the two generated dist entries + rules.
- session-quick-reference: current-state snapshot, commands, gotchas, layout.

function synthSortKeys(obj) {
if (obj === null || typeof obj !== 'object') return obj
if (Array.isArray(obj)) return obj.map(sortKeys)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: Undefined function reference — sortKeys is not defined in this scope

The function is named synthSortKeys (line 25), but the recursive calls on lines 27 and 30 reference sortKeys. This will throw ReferenceError: sortKeys is not defined at runtime whenever synthDigest is called with a nested object or array.

Suggested change
if (Array.isArray(obj)) return obj.map(sortKeys)
if (Array.isArray(obj)) return obj.map(synthSortKeys)

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba33d95. synthSortKeys now self-references synthSortKeys (here and line 30).

Context: sortKeys is defined in revision.mjs, so this worked in the concatenated dist via cross-module scope (which is why all tests passed) — but it was an undefined reference when synthesis.mjs is imported standalone, violating the module's stated self-contained invariant (// Defined independently to keep this module self-contained in the concatenated dist) and fragile against emit-order changes.

The fix is digest-identical (both functions key-sort the same way) — dist behavior is byte-for-byte unchanged. Added a source-scope guard in tests/synthesis-status.test.mjs (rejects a bare \bsortKeys\b) to prevent this recurrence. Dist regenerated, drift-free; 1470 tests pass.

if (Array.isArray(obj)) return obj.map(sortKeys)
var sorted = {}
for (var key of Object.keys(obj).sort()) {
sorted[key] = sortKeys(obj[key])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: Same sortKeys undefined reference — should be synthSortKeys

Suggested change
sorted[key] = sortKeys(obj[key])
sorted[key] = synthSortKeys(obj[key])

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba33d95 (same root cause as line 27) — now sorted[key] = synthSortKeys(obj[key]). See the reply on line 27 for full context and the regression guard.

function tokensRemaining(accountant) {
if (!accountant.limits.tokenCeiling) return Infinity
var reserved = totalReserve(accountant)
return Math.max(0, accountant.limits.tokenCeiling - accountant.tokensSpent - reserved)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Unit mismatch — totalReserve returns a value in call units, but it's subtracted from tokenCeiling

The reserve values are set as call-unit quantities (e.g., DESIGN_RESERVE_CALLS = 10), but tokensRemaining subtracts the same call-unit number from the token ceiling. If tokenCeiling is ever characterized (non-zero), this would incorrectly reduce the token budget. Currently harmless because tokenCeiling defaults to 0 (line 24), which causes tokensRemaining to short-circuit to Infinity at line 70. Consider introducing separate call and token reserve counters, or at minimum add a comment documenting the assumption.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documented in ba33d95. Added a note that totalReserve() is denominated in call units and token-unit reserve accounting is deferred until tokenCeiling is characterized in real terms (v1.5.0 cleanup D3 added the measurement plumbing; numbers need a dogfood run).

Did not change the formula: the current behavior (call-unit reserve subtracted from the token budget) is intentionally encoded in tests/phase05-nyquist-validation.test.mjs (e.g. tokensRemaining = tokenCeiling − reserve) and is harmless while tokenCeiling is uncharacterized — it defaults to 0, so tokensRemaining short-circuits to Infinity before this line. Introducing separate call/token reserves now would be speculative (YAGNI — no real token ceiling to reserve against yet); deferred until token characterization lands.

@kilo-code-bot

kilo-code-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Resolution of Previous Findings

All 3 issues from the previous review (at 4dec00d6) have been resolved in the incremental commits:

Severity File Line Resolution
CRITICAL synthesis.mjs 27 ✅ Fixed — sortKeyssynthSortKeys
CRITICAL synthesis.mjs 30 ✅ Fixed — sortKeyssynthSortKeys
WARNING budget-admission.mjs 69–73 ✅ Addressed — comment documenting call-vs-token unit mismatch and deferred resolution (v1.5.0 cleanup D3) added

A regression test was added in tests/synthesis-status.test.mjs to prevent the sortKeys bug from recurring.

Files Changed in This Increment (5 files)
  • plugins/feature-workflows/workflows/src/synthesis.mjs — sortKeys fix
  • plugins/feature-workflows/workflows/src/budget-admission.mjs — comment addition
  • plugins/feature-workflows/workflows/feature-pipeline.js — dist regeneration
  • plugins/feature-workflows/workflows/fp-extract-slice.js — dist regeneration
  • tests/synthesis-status.test.mjs — regression test
Previous Review Summary (commit 4dec00d)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 4dec00d)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 2
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
plugins/feature-workflows/workflows/src/synthesis.mjs 27 sortKeys undefined — function is named synthSortKeys; will throw ReferenceError at runtime
plugins/feature-workflows/workflows/src/synthesis.mjs 30 Same sortKeys undefined reference (recursive object key call)

WARNING

File Line Issue
plugins/feature-workflows/workflows/src/budget-admission.mjs 72 totalReserve() returns call units but is subtracted from tokenCeiling (token units) — latent design mismatch
Files Reviewed (165 files)

Key files reviewed:

  • plugins/feature-workflows/workflows/src/ — 30 source modules
  • plugins/feature-workflows/workflows/ — 2 dist entries + meta
  • plugins/feature-workflows/agents/ — 31 agent configs
  • scripts/ — build + validation scripts
  • tests/ — 40+ test files
  • .planning/ — planning artifacts
  • .serena/ — project memories
  • README.md, plugin.json

Notable observations (summary-only, not in changed lines):

  • plugin.json version stays at 1.4.5 while the PR claims v1.5.0 — this is acknowledged as a separate release step
  • Several .serena/memories/ files reference stale .claude/ paths that no longer exist
  • decisions.mjs:3 has a dead import of consolidate (pre-existing)
  • Test files contain structural/regex-based assertions that may be fragile against refactoring

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4-pro · Input: 20.7K · Output: 4.7K · Cached: 154.8K

Review guidance: REVIEW.md from base branch main

…serve doc

- synthesis.mjs: synthSortKeys recursed via bare sortKeys (defined only in revision.mjs). Worked in the concatenated dist via cross-module scope, but was an undefined reference in source scope and violated the module self-contained invariant. Now self-references synthSortKeys; digest output is byte-identical (both functions key-sort the same way), so dist behavior is unchanged. Added a source-scope guard in synthesis-status.test.mjs (no bare sortKeys) to catch this regression class.
- budget-admission.mjs: documented that totalReserve is call-unit and token-unit reserve accounting is deferred until tokenCeiling is characterized (v1.5.0 cleanup D3). Did not change the formula — current behavior is intentionally encoded in phase05-nyquist-validation tests and is harmless while tokenCeiling is uncharacterized.
- Regenerated dist (both entries), drift-free; 1470 tests pass.
@kostua16
kostua16 merged commit a6910e0 into main Jul 23, 2026
3 checks passed
@kostua16
kostua16 deleted the worktree-ver1.5.0 branch July 23, 2026 00:21
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.

1 participant