Skip to content

Preserve tool receipts across CLI repair, save and resume - #375

Merged
Brian Krabach (bkrabach) merged 3 commits into
mainfrom
test/preserve-repaired-tool-results
Oct 20, 2026
Merged

Brian Krabach (bkrabach) merged 3 commits into
mainfrom
test/preserve-repaired-tool-results

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add real repair/save/resume regression coverage against the installed Foundation
dependency, with the dependencies needed to run it from a clean locked install.
No CLI production Python, repair policy, runtime context default or CI exclusion
is changed.

  • Exercise the existing installed CLI repair and save helper bodies with real
    SimpleContextManager, CLI SessionStore/Foundation storage, and the actual
    resume initializer across four save/load cycles and backup rotation.
  • Preserve original tool-result payloads, correlation IDs and metadata. Check
    healthy no-op repair, late results, and parallel batches with a truly missing
    result. Do not keep the old assertion that genuine late results are deleted.
  • Declare context-simple from its public main branch in the dev group only.
    The lockfile records the tested commit
    db641363013ff906b656f49498a87ab01f5c506f for reproducible CI. Updating that
    dependency's lock resolution will follow main; the manifest is not pinned
    to that commit.
  • Refresh only Foundation's locked source to merged PR446 commit
    a5f91fc4765dd3c6a1496b400c4fe428e5aa06f2. Keep Core 1.6.1 and every unrelated
    package resolution unchanged. The only added package is context-simple.
  • Record the clean locked-install requirement in existing test guidance.

Why the dependency repair matters

The previous cross-repo DTU run explicitly installed extra dependencies and
proved the regression behavior, but did not prove this repository's standard
locked setup. Its old lock still selected pre-fix Foundation, and the new real
context import was undeclared. A main-ref requirement alone does not advance an
existing Git lock. This PR repairs both gaps rather than skipping the tests,
injecting a neighboring checkout into sys.path, or adding a runtime module
dependency.

Upstream microsoft/amplifier-foundation#446 is already
merged and its six main CI jobs passed. That change owns receipt preservation:
it can move a genuine result next to its call, while preserving the whole
message; it does not promise immutable chronology. Ambiguous associations retain
their evidence and remain broken. This CLI PR adds regression coverage, not a
different repair algorithm.

Verification

After switching the dev dependency to @main, a fresh workspace-local Python
3.12.3 environment was created only through
uv sync --locked --all-extras --dev, with no supplemental dependency installs:

  • Installed direct_url.json verified requested_revision=main and the exact
    locked Foundation and context-simple commits. Foundation/context imports came
    from the environment's site-packages, not neighboring checkouts. Core remained
    1.6.1. Only requested-ref metadata changed in this follow-up; the resolved
    context-simple commit and every other dependency stayed unchanged.
  • Four targeted repair/session/store/root-state files: 64 passed.
  • Full default CLI suite: 2,743 passed, 3 existing skips, 13 configured
    integration deselections, 1 existing xfail
    .
  • Separate POSIX integration selection: 13 passed.
  • uv lock --check --offline, locked sync check and uv pip check passed.
    The lockfile did not change during installation or test execution.

The original dependency-repair full run had six failures because the isolated
TMPDIR made existing Unix handoff socket paths 128 bytes, above Foundation's
explicit 103-byte bound. Only the private workspace TMPDIR was shortened
(endpoint 96 bytes); all seven handoff tests and the entire default suite then
passed without source/test changes, new skips or guard changes. The original
failure is retained. This main-ref follow-up reused the corrected private
TMPDIR, without changing product or test code.

Offline test controls positively exercised local AF_UNIX IPC and rejected IPv4
and DNS before tests. All external network access remained denied during the
checks. No live model, vendor or desktop qualification is claimed.

Earlier isolated cross-repo DTU validation independently ran the same committed
regression with Core 2.0.2 (64 targeted passes). The dependency-only repair and
main-ref follow-up use the actual committed Core 1.6.1 resolution. No new DTU or
Gitea was launched for these packaging increments. Local Python 3.11/macOS/Windows
were not executed; hosted matrix and POSIX integration checks remain the PR
gates. The previous head's eight hosted CI jobs passed; new-head CI must be
evaluated separately after this update.

Review and limits

The prior regression/design was reviewed through second-opinion by Astra and
Fable on supplied code/evidence. Fable's dependency-resolution condition is
addressed by the fresh locked-install evidence above. A separate independent
source/lock/receipt review approved the dependency repair for publication;
these are not GitHub approvals or full live-application qualification.

The test-only AST helper extracts known definitions from trusted installed CLI
source, never user/transcript input; it carries a statement-local S102 rationale.
Construction is mocked and root_state=None for the repair/resume cases: this is
not a full interactive REPL or shared-root-lock acceptance claim. No public
fixture corpus or raw machine/session evidence is added.

No merge, normal user installation, global settings edit, Legacy migration, or
change to the separately open Managed/Chat Completions PRs is included.

Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
Generated with Amplifier

Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
@bkrabach
Brian Krabach (bkrabach) merged commit ffc4666 into main Oct 20, 2026
9 checks passed
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.

2 participants