Repository navigation
feat(harness-state): persist content-addressed harness state lineage - #78
Merged
Merged
Conversation
Pepps233
marked this pull request as ready for review
August 16, 2026 16:33
Contributor
|
9044109: rename from system prompt evolution → evolution memory notes
For more context: System prompts describe SYSTEM.md → this should be immutable because it is carefully tuned by us Another layer of system prompts describe AGENTS.md/CLAUDE.md → this is handled by the user as user instructions |
Pepps233
approved these changes
Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Diffex needs a stable, verifiable representation for evolvable harness memory before consumers can store revisions or reason about their lineage. This PR adds a private harness-state package that persists evolving memory as a portable directory bundle, identifies it via the packaged harness content's exact bytes (only
EVOLVE.mdfor now) with a SHA-256 content hash, and records the predecessor hash used to derive each state.EVOLVE.mdcontains notes collected throughout the evolution process to improve Diffex's behavior. The packaged harness state intentionally remains separate from actual codebase changes.Reasoning
Keeping the schema and persistence contract in a dedicated private package gives future consumers one runtime-validated ownership boundary without coupling storage to the coding agent. Hashing the exact memory bytes makes identity sensitive to all meaningful serialized content, including line endings and trailing whitespace. For now, the harness state is represented by the hash of its evolving memory notes. Names and more precise details can be included in the harness metadata in
manifest.jsonlater. Recording onebasehash provides the minimum lineage primitive needed by later workflows without making this package responsible for resolving predecessors, validating graphs, or managing evolution.A root state uses its own content hash as its base, so manifests remain structurally uniform without a nullable sentinel. The strict two-file layout keeps bundles inspectable and portable, while sibling staging and a final rename avoid exposing partially written destinations during normal saves. This structure is also scalable: when additional harness components can evolve, they can be represented in metadata or other files. The package deliberately does not provide cross-process coordination or durability guarantees beyond that staging boundary.
Changes
@diffexai/diffex-harness-stateESM workspace package with strict TypeBox state, manifest, and bundle schemas plus inferred readonly types.memoryfield containing evolving notes fromEVOLVE.md.contentHashfor the exactEVOLVE.mdbytes and a requiredbasehash identifying the predecessor.{ state, manifest }bundle from both load and save operations so callers receive the persisted identity and lineage metadata.Testing
node ../../node_modules/vitest/dist/cli.js --run test/harness-state.test.tsnpm run check