@@ -715,6 +715,49 @@ guard that checks whether compaction preserves facts explicitly marked as
715715critical for the next action while those facts are pushed out of the recent
716716verbatim tail.
717717
718+ 12 . Adaptive context self-improvement e2e.
719+
720+ Run the optional self-improvement target:
721+
722+ ``` sh
723+ make test-agent-context-self-improvement
724+ ```
725+
726+ This target is intentionally separate from default ` make test ` : it requires a
727+ real model/backend and asks DS4 to operate a complete agent loop. The harness
728+ creates a temporary repository with a small failing Python project, then the
729+ prompt requires DS4 to:
730+
731+ - create a context checkpoint before changing the project,
732+ - inspect repository status,
733+ - read and fix the failing code,
734+ - run the project test,
735+ - inspect the resulting diff,
736+ - create a second context checkpoint after the test passes,
737+ - restore from that checkpoint,
738+ - inspect repository status again,
739+ - run the test again,
740+ - write a ledger with the exact actions and final result.
741+
742+ The Git inspection step is adaptive. If the model-visible schemas include the
743+ native Git tool, the prompt asks DS4 to use it for ` status ` and ` diff ` . If that
744+ tool is absent, the same prompt requires the existing ` bash ` path with
745+ ` git status --short ` and ` git diff ` . This keeps the context/KV branch
746+ independent from the Git-tool branch while still letting the same test exercise
747+ the native Git path after integration.
748+
749+ This test is not a claim that DS4 has optimized DS4 itself. It is a controlled
750+ regression test for the agent loop shape: inspect, edit, test, diff,
751+ checkpoint, restore, retest, and record evidence.
752+
753+ The stronger product demonstration should be a DS4-on-DS4 optimization loop:
754+ ask DS4 to inspect this repository, select one small measurable optimization,
755+ implement it, run the relevant benchmark or e2e check, inspect the source diff,
756+ checkpoint and restore the successful state, and record whether the metric
757+ improved. That is the right next target, but it should remain an optional slow
758+ evaluation because it is more expensive and less deterministic than a controlled
759+ temporary-repository regression.
760+
718761### Resume Point: 2026-05-25
719762
720763The DS4-generated context loop was run successfully with:
0 commit comments