Skip to content

fix(agent): harden evolution evidence and runtime - #108

Merged
Pepps233 merged 27 commits into
fix/evolve-unprocessed-materialized-tokensfrom
feat/evolution-relevance-and-runtime-bounds
Aug 23, 2026
Merged

Pepps233 merged 27 commits into
fix/evolve-unprocessed-materialized-tokensfrom
feat/evolution-relevance-and-runtime-bounds

Conversation

@Pepps233

@Pepps233 Pepps233 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hardens evolution evidence relevance and reflection execution with semantic lifecycle filtering, durable exclusion accounting, bounded provider and node runtime, task lineage, actionable curator validation, and end-to-end lifecycle coverage.

Reasoning

Routine startup, shutdown, resume, and provider-switch activity could create trace evidence and affect evolution thresholds even when no user task occurred.

Substantive sessions ending in shutdown also needed their task evidence retained while trailing lifecycle operations were excluded and auditable cursors continued to advance.

Recursive reflection could multiply internal provider rounds, overproduce lessons, and stall without complete budgets or deadlines, while proposals lacked enough task lineage and relevance validation to distinguish actionable harness memory from observer documentation.

Changes

  • Adds semantic evidence eligibility, lazy trace creation, shutdown-tail stripping, and diagnostic-only lifecycle failure retention.
  • Persists exclusion decisions, consumes contiguous excluded ranges, and aligns thresholds and progress totals with eligible evidence only.
  • Separates leaf, synthesis, and final lesson limits while accounting for every internal provider round and node-local tool or refinement budget.
  • Adds provider, node, and stage deadlines with resumable timeout checkpoints and durable runtime metrics.
  • Runs independent leaf reflection with deterministic bounded concurrency and node-local provider-call identities.
  • Propagates stable prompt lineage and requires curator relevance certificates that reject observer-only proposals.
  • Verifies startup, resume, provider switching, exit-only sessions, substantive shutdown, failed turns, and mixed eligible and excluded evidence ranges.

Testing

  • npm run check
  • node ../../node_modules/vitest/dist/cli.js --run test/invocation-tracing.test.ts test/evolution-runtime.test.ts from packages/coding-agent
  • node ../../node_modules/vitest/dist/cli.js --run test/evidence-eligibility.test.ts test/control-plane.test.ts test/reflector.test.ts test/curator.test.ts from packages/evolution
  • node ../../node_modules/vitest/dist/cli.js --run test/materializer.test.ts test/harness-trace.test.ts from packages/harness-trace
  • ./test.sh with all workspaces passing

- Keeps startup and shutdown metadata out of evolution inputs
- Preserves task messages, tool results, and substantive operations
- Locks idle abort operations out of evolution eligibility
- Prevents interface shutdown paths from becoming learned behavior
- Keeps substantive task evidence eligible when shutdown follows
- Prevents abort spans and routine footers from reaching reflection
- Buffers session and harness metadata until substantive work occurs
- Avoids raw files for routine startup and shutdown sessions
- Keeps standalone runtime failures in diagnostic traces only
- Admits error context when it accompanies substantive task evidence
- Records excluded trace identities and semantic reasons atomically
- Keeps diagnostic sources auditable without copying them into prompts
- Advances the durable cursor across contiguous excluded evidence
- Prevents lifecycle-only files from being reconsidered on every check
- Uses one eligible set for overview counts and token estimates
- Freezes the same sources for downstream reflection
- Limits each evidence leaf to three behavior-changing lessons
- Reinforces the bound in prompts, schema, and response parsing
- Caps intermediate synthesis nodes at five lessons
- Allows up to ten durable final lessons for curation
- Charges each underlying reflector provider call to the durable budget
- Bounds internal tool-use loops at ten provider rounds
- Isolates evidence and lesson-inspection budgets per node
- Separates two refinement rounds from response correction retries
- Stop stalled provider streams at explicit connection, idle, and absolute deadlines.
- Preserve timed-out node checkpoints and incomplete evidence coverage without blocking independent work.
- Capture provider latency, output usage, tool rounds, retries, node duration, and foreground waits.
- Store measurements with durable node checkpoints for accurate evolution cost accounting.
- Run independent leaf nodes with a fixed concurrency of two.
- Derive provider-call identities from node-local counters so scheduling cannot alter checkpoints.
- Require each curator decision to identify a task, causal behavior, concrete change, and verifiable result.
- Exclude observer-only and telemetry-format facts while consolidating behavior-changing lessons.
- Assign every prompt operation a stable task-lineage identifier.
- Carry lineage through session segments and materialized evidence so proposal support remains independently countable.
- Exercise exit-only, mixed-range, substantive-shutdown, and failed-turn behavior across tracing and evolution.
- Remove completed traces that contain no substantive payload while preserving unclassifiable diagnostics.
@Pepps233 Pepps233 self-assigned this Aug 22, 2026
@Pepps233
Pepps233 requested a review from Issacboy123 August 22, 2026 13:24
- Require substantive messages or failed operations before evolution
- Keep lifecycle spans only as context for anchored work
- Delete complete non-substantive traces after clean shutdown
- Preserve aborted and incomplete traces for diagnostics while excluding them from evolution
- Allows the first validated mutation batch to initialize a blank EVOLVE.md
- Preserves strict destination validation once memory exists
- Keeps model-authored memory concise with a three-sentence validation boundary
- Assigns monotonic numbers at persistence so the model cannot choose them
- Gives every session one content-addressed source for the next lesson number
- Keeps active EVOLVE.md lessons contiguous after removals without model involvement
- Makes metadata-bearing revisions unambiguous before release
- Covers strict schema rejection and repeated live switching
- Prevents UTF-8 encoding from changing content-addressed harness state
- Keeps repeated saves deterministic by rejecting lone surrogate code units
@Pepps233

Copy link
Copy Markdown
Contributor Author

#93 (review) resolved by d2dc737

- Lets users persistently disable self-evolution from the interactive menu
- Prevents disabled sessions from running evolution or retaining invocation traces
- Select the default agent at launch and scope /version to the current directory
- Replace raw IDs with reusable semantic harness, job, proposal, and evidence labels
@Pepps233
Pepps233 merged commit f0f9d12 into main Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant