Skip to content

docs: establish native context folding S01 baseline - #606

Draft
LeXwDeX wants to merge 2 commits into
devfrom
feat/native-context-folding-s01
Draft

LeXwDeX wants to merge 2 commits into
devfrom
feat/native-context-folding-s01

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Why

Issue #605 requires the source and delivery contracts to be frozen before any dynamic context-folding implementation begins. The two session stacks differ in message shape, tool registration, provider transformation, compaction entry points, and test artifact paths; these seams need positive, testable mappings before a default-on implementation can start.

Closes #605

This draft records S01 only and must remain unmerged until S02–S10 complete; S01 itself does not close the issue.

What changed

  • Added the approved native context-folding design, implementation plan, and an evidence-backed S01 audit.
  • Fixed Core read acceptance to positively map verified ReadTool.TextPage.content while requiring complete input and outer-field equality and preserving the JSON result type, schema, and stored history.
  • Fixed Claude/Mistral acceptance to reuse one extracted host call-ID normalizer, validate final transformed call/result pairs, and positively cover non-colliding mappings; only collisions or unknown transforms skip.
  • Adopted the bounded session/instance source-identity ledger as the formal provenance design. It stores no input, output, path, fingerprint, candidate, or plan and is distinct from a forbidden cross-request dedup cache.
  • Corrected the license wording to independent implementation from the project specification without direct external-source copying; the documents do not claim a legal clean-room process.
  • Recorded the actual Issue/PR, Bun and SpecGit versions, hook state, document-formatting result, and delivery gates.
  • Changed no product code and did not enter S02, enable the feature, merge, deploy, or publish.

Evidence

  • Baseline: origin/dev@4b554abd9dac6ae93c46b555b60dcb478eff7be6.
  • Initial S01 commit: 7bbc09761afe8ea4f22cc01d10ef6c799bf87708.
  • Audit-correction commit: 22576d58a8411f5c59de2e4f0bd7a553565de517.
  • Full audit: docs/context-folding/evidence/S01.md.
  • The graph located ReadTool.TextPage at packages/core/src/tool/read-filesystem.ts:77-84; coverage reported no recorded issue and direct source reading confirmed type/content/mime/offset/truncated/next.
  • Prettier 3.6.2 initially rejected the three edited Markdown files; after formatting, prettier --check passed and git diff --cached --check passed.
  • Pinned Bun is 1.3.14; local Bun is 1.4.2. The first push did not run pre-push typecheck because core.hooksPath=.husky/_ but that wrapper directory is absent, so the documentation does not report a local typecheck pass.
  • SpecGit created Issue feat: add native dynamic context folding #605 and Draft PR docs: establish native context folding S01 baseline #606. The request targets dev, remains draft, and the branch head is the audit-correction commit.
  • This documentation-only step has no runtime artifact, so no product deployment applies. Product tests and dev prerelease acceptance remain S02–S10 work.

Checklist

  • The diff is limited to the two approved specs and the S01 evidence record.
  • A01–A05 corrections are represented in the formal design, step plan, test matrix, and evidence record.
  • Every material claim is tied to current-source lines, graph coverage metadata, or raw command output.
  • The branch is pushed for parent-task re-review and remains draft, unmerged, and undeployed.
  • Parent task has approved S01 and authorized S02.

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.

feat: add native dynamic context folding

1 participant