Skip to content

feat: add memcode TUI harness with verified native restore - #6515

Merged
nikhilachale merged 34 commits into
OrchestratorInc:mainfrom
nikhilachale:feat/memcode-tui-harness
Oct 18, 2026
Merged

nikhilachale merged 34 commits into
OrchestratorInc:mainfrom
nikhilachale:feat/memcode-tui-harness

Conversation

@nikhilachale

@nikhilachale nikhilachale commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Code changes: +1439 -72
Tests: +1647 -3
Others: +271 -3

Current-head CI recovery (2026-10-18)

Current head: ad0c14c60a3ee4b687704536974bf952ead8df23, based on main 6f299014062c392b82b820b23dc08affcaaff04f. Fixed the sole CI lint failure at the preceding head by moving the existing CatalogFingerprint doc comment back immediately above the exported function. No behavior changed and no lint checks were excluded.

Full pinned golangci-lint v2.13.2 ruleset passed locally with 0 issues on an LF source export targeting Linux (GOOS=linux, CGO_ENABLED=0). Build/vet and focused spawn/restore regressions passed before this comment-only change; complete adapter suites passed for the endpoint helper change. All 24/24 CI checks passed on exact head ad0c14c60a3ee4b687704536974bf952ead8df23, including full backend race suites, aggregate Go gate, frontend validation, platform CLI/container checks, lint, cloud tests and API/sqlc drift. Completed exact-head Go workflow. AO exact-head review run 3e919f53-cc84-4e45-9298-0fb1f89a8ea9 approved with no further findings; its provider POST returned HTTP 401, so it is an internal AO approval. GitHub separately reports APPROVED, MERGEABLE and CLEAN; the PR is still draft because native/UI qualification is incomplete. Final local native auth preflight still reports not authenticated. Earlier head-specific results below are historical.

PR remains draft and is not merge-ready: current native auth reports not authenticated, and current-head registered-AO native lifecycle plus actual Electron evidence are still missing. The exact prerequisites and proof gaps are recorded below. Do not equate CI or internal AO approval with native/UI qualification. No merge is being performed. One binary asset has no line count.

Spawn endpoint review follow-up (2026-10-18)

Current head: 89bccecfdcd14207339025196bcda878693ddf62, based on main 6f299014062c392b82b820b23dc08affcaaff04f. Fresh Memcode spawns now clear inherited project/role model defaults when any recognized custom endpoint source is present. Endpoint detection runs after the workspace and effective launch environment are available and before hooks or launch validation. Explicit per-spawn model overrides remain errors for custom endpoints; rejection happens before runtime creation. Both adapter launch config and persisted model metadata use the cleared choice.

The spawn regression exercises real Memcode hook installation and model validation for project environment, daemon environment, global .env, workspace endpoints, no-endpoint controls, and malformed configuration. It covers base project defaults, role defaults, and explicit overrides. Build/vet and focused spawn, startup/native restore, saved model/effort regressions passed. Complete adapter suites passed for the preceding endpoint helper change. AO re-review approved exact head 89bccecfd with no further required changes; the provider review POST returned HTTP 401, so that AO approval was not published to GitHub. GitHub separately reports its existing review decision as APPROVED. Exact-head CI is running. Previous-head CI sections are historical and do not qualify this head.

The full Windows backend run at rebased head 81b023be8 completed with platform/environment failures (shell, modes, ACLs, symlink privilege) and a session-manager timeout. It is not a local full-suite pass. Linux race validation remains unavailable locally with CGO disabled; frontend dependencies are absent. Supported full suites are being verified in remote CI. Native/UI qualification remains incomplete; PR stays draft and no merge is being performed. Neither endpoint finding has a provider thread because the review POSTs returned HTTP 401. Binary assets have no line count.
Current-host qualification preflight (2026-10-18): installed Memcode 0.46.0 reports not authenticated; this checkout has no frontend dependencies. The historical native-only 0.38.1 receipt and NOT_RUN Electron checkpoint list do not qualify this head. Missing current-head proof: registered-AO fresh/restored private instructions with project/user-hook preservation and exact conversation history/identity, executing-turn cancel/active Kill isolation with no late effects, and actual Electron harness/model/task/follow-up/archive/restore/Kanban/reconnect checkpoints. Completion requires an authenticated authorized native profile on a qualification host. No secrets should be shared in chat. Keep draft; not merge-ready, even if CI passes.

Restore endpoint review follow-up (2026-10-18)

Follow-up head: e534089a5af93dd233439419cfa3d10d85ae82f4, rebased onto main 6f299014062c392b82b820b23dc08affcaaff04f. Restore now shares Memcode's native endpoint detection with model validation: project launch environment, daemon environment, global .env, and workspace .memcode/config.json. A saved AO model is cleared for a custom endpoint so the TUI can use its own choice. Malformed configuration errors still surface before launch.

The manager regression invokes the real adapter model validator at the launch boundary. It covers all four endpoint sources, valid opus without endpoints, unsupported saved models, an empty endpoint list, and malformed configuration. Build and vet, complete memcode/hooksjson/activitydispatch suites, and focused startup/native restore/saved model/effort regressions passed locally. New-head CI is pending. The earlier rebased head reached 17 successful CI checks before this follow-up; its results do not qualify the new head.

The full Windows backend attempt at rebased head 81b023b completed with platform/environment failures and a session-manager timeout; Linux race execution is unavailable locally with CGO disabled, and frontend dependencies are absent. Those checks are being verified in CI. Native/UI qualification remains incomplete; the PR remains draft and is not being merged. The AO review POST returned HTTP 401, so there is no provider inline thread to resolve for this finding. Binary assets have no line count.

Rebase onto current main (2026-10-18)

Rebased onto 6f299014062c392b82b820b23dc08affcaaff04f; rebased head is 81b023be8fe7e77b4d5cc46afc57fdde09397ac5. Resolved overlaps while preserving main's harness support, asynchronous catalog checks, restore effort/identity handling, model visibility, and migration ledger. GitHub reports the rebased head mergeable. All previous review fixes remain in place.

Validation on this head: backend build and vet passed; complete memcode, hooksjson and activitydispatch suites passed; memcode/catalog and Aider grouping regressions, focused startup/native restore/saved model/effort checks, and migration regressions passed. Full Windows backend suite completed with environment-dependent failures and a session-manager timeout (Unix shell, file modes, credential-home/ACL assumptions); the caller-deadline regression also fails locally. Linux race coverage is unavailable locally (CGO_ENABLED=0); frontend dependencies are absent. New-head CI is pending and will validate the supported runner suites. Earlier successful CI sections below refer to their recorded historical heads, not this rebased head.

The PR remains draft pending native/UI qualification; rebasing does not complete those gates. Verified net GitHub change counts remain unchanged; the binary asset has no line count.

Additional review follow-up, 2026-10-17: fd83c6faa340de0a95db02d1a3f6974ac9acbff4. Addressed and resolved the two additional comments found during the final thread audit. Resolve the startup command before readiness polling, returning immediately when both command and task prompt are empty. During restore, clear the saved AO model when the effective project launch environment has a custom endpoint; native hosted catalog choices still persist and explicit custom-endpoint spawn overrides remain rejected. Added a real-adapter no-readiness regression and extended saved-model restore coverage. All review threads are resolved.

Focused session-manager regressions, full memcode/hooksjson suites, backend build and vet pass locally. The full affected session-manager suite completed with the known Windows home-path, ACL and installed-CLI failures; the new and related focused regressions pass. All 24/24 CI checks passed on this exact head, including the full backend race suites and aggregate gate, frontend validation, platform CLI checks, lint and generated-contract drift checks. Completed checks. Runner scheduling delayed the final jobs; no failed checks, reruns or additional recovery commits were required. Earlier head-specific CI results below remain historical. Native/provider/UI qualification remains incomplete and the PR stays draft.

Hook-performance follow-up, 2026-10-17: 503848623b1155f40b1531e47db69071ec6ec250. Addressed and resolved the new hook-process cost comment. Pin a private per-launch chunk count so unused slots return before opening or decoding the instruction snapshot. Active slots reject stale counts; older launches retain their decode fallback. Shared hooks still use 64 stable slots, and each slot still starts a process.

Added regressions and BenchmarkInstructionHookSlots with legacy/launch-count controls. On this shared Windows i7-12700H host, the 64-slot in-process loop measured 2.29 ms to 0.148 ms (one chunk), and 15.37 ms to 1.20 ms (four chunks). Synthetic CLI-only process loops were around 2.1 seconds; initial PowerShell-plus-CLI loops were 29-40 seconds under concurrent validation load. After local test/lint load ended, a repeat measured 2.253 s before / 2.198 s after for 64 CLI starts and 12.574 s before / 12.971 s after with PowerShell (one sample per build). Process/shell startup dominates; these samples establish no end-to-end speedup and do not complete the missing native/UI qualification.

Backend build/vet, full memcode/hooksjson suites and focused CLI regressions pass locally. Full backend Windows validation encounters the previously documented environment failures; Linux-target local lint encounters checkout-wide CRLF/goimports differences. All 24/24 CI checks passed on this exact head, including full backend race suites and aggregate gate, frontend validation, platform CLI checks, lint and generated-contract drift checks. Completed checks. Earlier head-specific validation below remains historical. The PR remains draft.

Review follow-up, 2026-10-17: e22e1bcae7fa5aea9f09b02ffcd55d5209924d28. Addressed and resolved all nine open inline review threads and fixed the additional saved-model restore comment. Merge current main (acf34d529) and reconcile the harness imports, restore configuration and migration ledger; GitHub reports the head mergeable.

Model selection runs on promptless launches and restores, uses an exact model token and current styled viewport confirmation, rejects project-env custom endpoint overrides, and drops unsupported inherited saved models. Memcode context uses a private atomic snapshot and 64 fixed workspace hook slots, respecting the upstream 8 KiB per-hook limit and avoiding cross-session chunk-count overwrites; unused slots still incur a hook process start. Reuse hooksjson.Manager for native flat arrays, 30-second timeouts, prefix-safe reconciliation and uninstall. Remove the unused post-tool-use hook and synchronous catalog cache check; disable self-update during binary identity probes and use generic catalog schema versions.

Validation: backend build and vet pass locally. Full memcode, hooksjson and activitydispatch suites pass, as do focused modelcatalog, agent-service, CLI, session-manager and migration regressions. Broader Windows suites encounter permissions, home-path and installed-CLI failures; local race tests are unavailable because CGO is disabled and no C compiler is installed. Local Linux-target lint reports checkout-wide CRLF/goimports differences. Docker, Linux/macOS runners and frontend dependencies are unavailable locally. All 24/24 CI checks passed on this exact head, including backend race suites and aggregate gate, frontend validation and renderer smoke, Linux/macOS/Windows CLI E2E, Windows workspace checks, lint, API/sqlc drift, cloud build/test, release feeds and secret scanning. Completed checks.

This review follow-up does not complete the previously missing native/provider/UI qualification. The PR remains a draft. The earlier publication/evidence history below is preserved.

Binary assets: 1 (excluded from line counts).

Current publication, 2026-10-15: a7e5fcdba0bc5f5ba2f63f0ecae5ccfc74e521c3. Incomplete qualification; AO UI evidence BLOCKED; not merge-ready. Main conflicts reconciled. Exact-head CI is recorded below; no local routine suites.

Published the composer panic-readiness fix, unrun regression cases, corrected model/chunk documentation and main reconciliation. A fresh native-only0.38.1 control observed initial/restored private/project/user-hook effects; this does not resolve the original registered-AO restored-token failure. Current AO/UI verification remains incomplete.

Current report and scoped evidence. Historical runtime/source attribution is retained there.

Exact-head CI (2026-10-15T07:12:32.952599+00:00): complete at a7e5fcdba0bc5f5ba2f63f0ecae5ccfc74e521c3 — 24 SUCCESS (24 reported; 24 expected including the merged Go aggregate gate). Current checks. Mergeability MERGEABLE, merge state BLOCKED; draft handoff. CI does not qualify missing native/UI/provider/OS gates. Initial cloud job failed with temporary cleanup-script text file busy; implementation/test bytes match canonical main. Original failure preserved. One affected-job rerun passed on the unchanged head. Canonical main subsequently advanced to48c4ef5e with only two non-overlapping preview-process files; GitHub reports this head mergeable. These completed checks belong to the stated publication head, not a newly rebuilt merge with that later base.

Preserved earlier description (historical status, validation and evidence snapshots)

Binary assets: 1 (memcode logo).

Summary

  • Add the memcode TUI harness, installation and login detection, model catalog and selection, workspace hooks, terminal activity, and verified native restore.
  • Integrate memcode with AO sessions, API types, the task composer, and the agent avatar.
  • Keep focused Go and frontend tests for the implementation. Remove research reports, screenshots, proof scripts, and proof-only workflows from this PR.

Validation

  • Memcode adapter Go tests pass locally.
  • Broader local Go tests are limited by Windows home-directory ACL and installed CLI assumptions; remote CI is the validation gate.

Known limitation

Native restore still needs an end-to-end check that a restored session consumes a subsequent new task. Keep this PR in draft until that behavior is verified.

@github-actions

Copy link
Copy Markdown
Contributor

🏆 Review leaderboard

Oct 3–10, 2026 · UTC

Rank Reviewer PRs reviewed Review rounds PR comments
🥇 @illegalcall @illegalcall 28 47 11
🥈 @ronishrohan @ronishrohan 20 23 17
🥉 @Vaibhaav-Tiwari @Vaibhaav-Tiwari 16 20 11
4 @Prasad-D-Ware @Prasad-D-Ware 10 27 1
5 @nikhilachale @nikhilachale 8 20 3
6 @axisrow @axisrow 8 10 47
7 @Rishet11 @Rishet11 7 16 2
8 @mohakchakraborty2004 @mohakchakraborty2004 7 7 1
9 @Pritom14 @Pritom14 5 5 3
10 @codebanditssss @codebanditssss 4 4 2

Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded.

Show 6 more reviewers
Rank Reviewer PRs reviewed Review rounds PR comments
11 @Annieeeee11 @Annieeeee11 3 6 1
12 @harshitsinghbhandari @harshitsinghbhandari 2 4 0
13 @neversettle17-101 @neversettle17-101 2 3 0
14 @whoisasx @whoisasx 2 2 0
15 @AgentWrapper @AgentWrapper 1 3 0
16 @ApexYash11 @ApexYash11 1 2 0

@nikhilachale

nikhilachale commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Full evidence report for 1c663e89b1b73e409610f2f9b16e6b023cd8776c. This records a native blocker; AO integration and AO UI screenshots are not claimed.

memcode TUI: native restore blocks registration

memcode is not registered or tested inside AO. The official Linux x86-64
v0.38.1 binary starts its native TUI, but an exact native resume exits 2 with
panic: ui: AppendString called without primary screen support. A new native
reproduction with a valid synthetic two-message transcript reproduces this
without credentials or provider turns. There is no AO screenshot or passing
AO integration claim.

Native memcode resume failure; AO not registered or tested

This is a real scrot capture of an xterm attached read-only to the retained
terminal pane from the new reproduction, captured on 2026-10-10 at 10:43 UTC.
It shows the native process's panic after exit, not AO's desktop, a historical
log rendered as an image, or the original earlier provider-backed attempt.

Reproduce

Use an independently installed official memcode v0.38.1, Python 3, Git, and
tmux on Linux. The script creates an isolated home and Git workspace under the
requested report directory, does not inherit provider credentials, submits no
model turn, and stops its own tmux server. It disables self-update and seeds
the native update-notice cache. Endpoint overrides point at loopback port 9.
It does not patch the native binary.

python3 test/harness/memcode_conformance.py \
  --binary /absolute/path/to/memcode \
  --report "$HOME/.ao/audits/memcode-restore-attempt-001" \
  --screenshots

--screenshots additionally needs Xvfb, xterm, and scrot. Missing capture tools
are reported as unavailable. Every report directory must be new. Startup is
bounded by --timeout (default 30 seconds per launch, maximum 120). The expected
v0.38.1 result is exit 1 with NATIVE_RESTORE_GATE_FAIL: fresh native readiness
passes, exact resume fails with process exit 2, and the saved transcript hash
is unchanged. A future passing result proves only this native fixture's
startup/restore gate, not provider continuity, permissions, hidden instructions,
or AO conformance.

When sharing a host, use a lock without passing its descriptor to detached
terminal processes:

flock --close "$HOME/.ao/audits/compute.lock" \
  python3 test/harness/memcode_conformance.py \
  --binary /absolute/path/to/memcode \
  --report "$HOME/.ao/audits/memcode-restore-attempt-002"

The credential-free fixture tests do not need an installed memcode:

PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover \
  -s test/harness -p 'test_memcode_conformance.py'

Pinned source and failure boundary

Input Value
Upstream memcode-ai/memcode
Released source v0.38.1 / afc80cf1718e
Executed platform Linux x86-64
Official archive SHA256 6f06f155922c592f6bbd4f642e0404299772f3fbd6bae335358309604a0bf544
Executable SHA256 89cd4375fce660d6c365163745ef83d78e76ad36e803fe4cebb952644fe4ddff
Screenshot SHA256 c14da3a27c990a3271f5e3784355f9bbfd20acf2418624ae92c7e339e4d65327

The archive matches the release's published checksums.
StartChat
prints a resumed-session banner during
InitState.
Its already-installed output callback calls EventContext.AppendString.
NewApp
still has the panic placeholder while mounting the widget tree, before backend
scrollback appenders attach. A session-start hook can report the correct native
ID before this panic, so that hook is not input-readiness evidence.

Source inspection of official v0.38.0, v0.37.0, v0.36.0, v0.31.0, v0.29.0, and
v0.20.0 found the same synchronous startup chain, banner, panic placeholder, and
session-start hooks. No practical earlier release was identified as a safe pin.
Only v0.38.1 was executed; those releases received source inspection, not
binary conformance verdicts.

Evidence and limits

These separate attempts ran on the authorized VPS. Original reports and captures
remain in their individual audit directories; later controls replace no failures.

Attempt Observation Classification
memcode-native-001 Composer accepted a leading-dash task; a hook-only token was written to proof.txt; active → idle and matching native transcript ID observed. Escape interrupted a subsequent active turn. Restore then exited before capture. Several native gates passed; restore failed. Not an AO audit.
memcode-native-restore-control-001 Retained terminal reproduced exact --resume exit 2 and initialization panic on the real saved transcript. Confirmed upstream native failure.
memcode-native-slash-resume-control-001 After fresh readiness, /resume <full-id> recovered the exact ID; a continuation appended a token introduced only after kill. Report then recorded Broken pipe. Individual native gates passed; original overall report remains non-pass.
memcode-committed-gate-001 Initial fixture omitted required models.coder and native startup rejected its configuration. Screenshot provenance mistakenly called this a panic; a separate correction accompanies the preserved report. Reproducer setup failure, not additional upstream panic evidence.
memcode-committed-gate-002 Corrected credential-free fixture: fresh TUI ready, exact resume exit 2, unchanged transcript, actual native screenshot above. Repeatable native restore blocker.

The slash-command control saved fresh_restore_token: true before its progress
print(..., flush=True) raised BrokenPipeError after transport stdout closed.
The terminal independently shows the appended token and settled composer. This
runner output failure does not erase those gates or make the original report pass.

Cancellation was narrower: the active turn stopped, but the resumed agent later
finished the earlier sleep 60 / cancelled.txt request before applying the
continuation. The audit did not prove cancellation of an already-running tool
or removal of cancelled intent from model history.

Integration decision

A fresh TUI followed by /resume <full-id> requires separate startup readiness,
native load, exact identity validation, and restored readiness. AO's current
native restore path treats a successful GetRestoreCommand as an in-command
resume and skips BuildAfterStartPrompt. Existing adapter boundaries cannot
safely express this two-stage workaround. A fresh TUI must not be labeled as
restored. This investigation adds no adapter or shared lifecycle workaround.

Other future integration gates remain:

  • Taskless run opens the TUI; positional or piped text selects one-shot mode.
    Initial tasks require verified initialized composer readiness.
  • TUI dispatch ignores --model. Endpoint selection must account for remembered
    LastModel taking precedence over MEMCODE_ENDPOINT_MODEL.
  • Session-start stdout appends standing context but is capped at 8192 bytes per
    hook. Preserve user hooks/default instructions and reject or safely split
    oversized instructions. Installation is not instruction-consumption proof.
  • Missing, corrupt, or empty history may silently start fresh. Validate the full
    ID and matching nonempty transcript, then verify restored identity.
  • --ask, --auto, and --allow-all differ; the last still asks about
    catastrophic commands. AO accept-edits behavior is unsupported.
  • Hooks lack prompt-submit, turn-settled, and permission-pending events.
    Terminal chrome and durable transcript boundaries need independent validation.
  • Credential presence remains configured, not verified authorization. The
    successful native Z.ai turn is not evidence of an AO auth probe.
  • Chat, reviewers, AO lifecycle/UI behavior, and AO screenshots remain untested.

@OrcInc OrcInc added this to the Agents & orchestration milestone Oct 10, 2026
@OrcInc OrcInc added comp/daemon Go daemon, process lifecycle, and backend control plane. enhancement New feature or request labels Oct 10, 2026
@nikhilachale

nikhilachale commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

memcode is integrated as TUI-only through supported initialized native /resume with exact identity/history witnesses, exclusive input and owned rollback. All lifecycle gates passed: 24 PASS / 1 auth BLOCKED / 1 catalog FAIL / 2 catalog NOT_RUN; overall diagnostic FAIL. Ask-mode ordinary Send refusal and changed selection, executing-shell Escape (593ms reap, native ready921ms, AO idle5081ms), and active-shell AO Kill (89ms reap) passed with32-second delayed-write/control-isolation checks. No Chat/handoff or model override support.

Detailed revision-pinned recovery report · evidence HEAD 62a2f5742a5756db0430a4c1c6020e87d5630416. Final current-head full CI verified below. Focused VPS tests passed; no full local suite/race pass claimed. Original failures remain in the report. Owned sessions, daemon and Electron stopped; final memcode numeric cleanup HTTP statuses were not persisted, with durable cleanup independently verified. No merge/release.

Real AO restored memcode

Real AO native Ask decision

Complete current evidence-head GitHub CI: 24/24 SUCCESS at 62a2f5742a5756db0430a4c1c6020e87d5630416. All checks completed; focused VPS tests are separate evidence.

@nikhilachale nikhilachale changed the title test: record memcode TUI resume conformance blocker feat: add memcode TUI harness with verified native restore Oct 10, 2026
@nikhilachale

nikhilachale commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Complete current evidence-head GitHub CI: 24/24 SUCCESS at 62a2f5742a5756db0430a4c1c6020e87d5630416. All checks completed; focused VPS tests are separate evidence.

Revision-pinned report and real AO Electron screenshots. Both harness audits remain diagnostic FAIL for reported auth/catalog gaps, with all functional lifecycle gates passing. Final cleanup also stopped two exact retained AO auth-workspace lazy PTY hosts and their two descendants; no credential data read. No full VPS suite/race pass, merge or release.

Comment thread .github/workflows/harness-fixtures.yml Resolved
Comment thread backend/internal/storage/sqlite/db.go Resolved
@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Harness-specific reports, JSON receipts, screenshots and provenance now live on this integration PR branch, rather than the skill PR #6509.

Evidence index with embedded screenshots and JSON links.

Historical successes, failures and scope limitations remain as recorded. Moving these files does not rerun native/AO testing or upgrade any verdict.

This is evidence relocation only. Existing tested source/native hashes and failures are preserved; the documentation commit is not a fresh runtime pass. Applicable checks run in PR CI.

Recorded harness evidence — see scope above

@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Canonical main conflicts reconciled at 324576a4f6a3, preserving previous source/evidence ancestry and every existing harness report/screenshot byte. Reconciliation receipt.

Validation is PR CI only; current-head checks are pending until GitHub reports them. This merge does not constitute a new native/AO run or promote historical fresh/restore/provider-role proof. Harness evidence stays on this integration PR; PR6509 remains reusable guidance and linked summaries.

@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Canonical main conflicts reconciled at 4c5b82ad36d7, preserving previous source/evidence ancestry and every existing harness report/screenshot byte. Reconciliation receipt.

Validation is PR CI only; current-head checks are pending until GitHub reports them. This merge does not constitute a new native/AO run or promote historical fresh/restore/provider-role proof. Harness evidence stays on this integration PR; PR6509 remains reusable guidance and linked summaries.

@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Canonical main conflicts reconciled at a3a4ef82e565, preserving previous source/evidence ancestry and every existing harness report/screenshot byte. Reconciliation receipt.

Validation is PR CI only; current-head checks are pending until GitHub reports them. This merge does not constitute a new native/AO run or promote historical fresh/restore/provider-role proof. Harness evidence stays on this integration PR; PR6509 remains reusable guidance and linked summaries.

@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Memcode actual registered AO audit evidence is owned by this integration PR at aff4832e60f2: report, asset hashes, restored NEW-token failure. Fresh private/native-project/existing-hook controls passed. Restored consumption failed. Executing Escape, independent AO Kill and missing-history rejection passed. Runtime/UI source a3a4ef82, released native0.38.1; actual authenticated wire role NOT_CAPTURED. CI-only released-role fixture includes a retained earlier headless-route failure and corrected TUI handshake. Draft retained; exact-head CI pending.

Actual registered fresh controls

Exact native restore and empty composer

Unrelated control usable after primary Kill

@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Canonical main and the green shared ACP replay CI budget reconciled at f13adf467e6e, preserving previous source/evidence ancestry and every existing harness report/screenshot byte. Reconciliation receipt.

The shared test-only fix PR6617 had21 green applicable checks; this integration head still needs its own exact-head CI. The full20543-frame replay burst and exact-once assertions remain unchanged. No routine local suites ran. This merge does not constitute a new native/AO run or promote historical fresh/restore/provider-role proof. Harness evidence stays on this integration PR; PR6509 remains reusable guidance and linked summaries.

@milesatao-svg

Copy link
Copy Markdown
Contributor
Screenshot 2026-10-14 163822

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. memcode support with verified native restore is a big addition. I'm requesting changes for the first five inline comments below, which are blocking: they can destroy a user's live session or make memcode sessions impossible to launch or restore.

  1. startup_health.go:57: a live session is destroyed on daemon restart if the start hook never bound the native identity.
  2. memcode.go:94: the advertised model config field is always rejected, which breaks every launch/restore when it's set.
  3. hooks.go:223: prompts over 8 KiB with whitespace after the last paragraph break before 8192 bytes fail to launch.
  4. manager.go:3302: interactive-native restore has no fresh fallback when there's no native history or identity.
  5. restore.go:60: a whole-file hash of messages.json treats harmless rewrites (e.g. saved_at) as tampering and rolls back a good restore.

The remaining comments (panic: detection scope, auth exit-code handling, signal coverage, the hardcoded harness check in the shared observer, and the duplicated frontend chip) are non-blocking but worth addressing.

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up pass on the same head (612f0d1bf). There are no new commits since my earlier review, so all ten earlier threads are still open and unchanged, including the five blockers. My CHANGES_REQUESTED still stands.

Status changes

  • CI hasn't run on this head. GitHub reports the PR as CONFLICTING with main, and no checks are attached to 612f0d1bf. That includes the new harness-fixtures, harness-proof-build, and memcode-released-role workflows. Please rebase or merge main so CI runs. main now has 0197_detach_split_orchestrator_conversations.sql, and the shippedMigrations ledger will conflict next to your 202 entry.
  • Local results on the PR head. These pass: go test for adapters/agent/{memcode,registry,activitydispatch}, observe/activity, service/{agentauth,systeminstall}, cli (-run 'Hook|Memcode'), session_manager and storage/sqlite (-run 'Memcode|NativeRestore|Interactive|Migration'), plus test/harness/test_memcode_*.py (10 tests). go vet is clean on the memcode and session_manager packages. None of these tests cover the two new findings below.

New findings (inline):

  1. cli/hooks.go:600: [Blocking] after a native restore, AO stops tracking the session's native identity.
  2. memcode/hooks.go:184: memcode's session history in the workspace isn't gitignored (non-blocking; please confirm what memcode does upstream).

Comment thread backend/internal/cli/hooks.go Resolved
@nikhilachale
nikhilachale force-pushed the feat/memcode-tui-harness branch from a4ea22c to 67d8ba4 Compare October 14, 2026 23:43
@nikhilachale

nikhilachale commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Published, incomplete qualification — AO UI evidence BLOCKED; not merge-ready.

Head a7e5fcdba0bc5f5ba2f63f0ecae5ccfc74e521c3; main 54b28374912cb2771f17b8cc32a9482e6d607bce reconciled without force-push. Published the composer panic-readiness fix, unrun regression cases, corrected model/chunk documentation and main reconciliation. A fresh native-only0.38.1 control observed initial/restored private/project/user-hook effects; this does not resolve the original registered-AO restored-token failure. Current AO/UI verification remains incomplete.

Publication report · All ordered screenshot checkpoints

Every applicable latest UI checkpoint remains NOT_RUN because this stage had no genuine isolated Electron dependencies and insufficient disk preserving512MiB. API/native receipts are auxiliary, never screenshot substitutes. No image was fabricated.

Exact publication-head CI is being checked separately below; old green heads do not qualify edited/merged source. No routine VPS tests, lint, typecheck, gofmt or CI emulator ran. Linux/provider evidence does not establish other OS/provider coverage. Original failures/profiles/logs remain intact privately. No skill6509 writes, production changes, merge, release or deployment.

Exact-head CI (2026-10-15T07:12:32.952599+00:00): complete at a7e5fcdba0bc5f5ba2f63f0ecae5ccfc74e521c3 — 24 SUCCESS (24 reported; 24 expected including the merged Go aggregate gate). Current checks. Mergeability MERGEABLE, merge state BLOCKED; draft handoff. CI does not qualify missing native/UI/provider/OS gates. Initial cloud job failed with temporary cleanup-script text file busy; implementation/test bytes match canonical main. Original failure preserved. One affected-job rerun passed on the unchanged head. Canonical main subsequently advanced to48c4ef5e with only two non-overlapping preview-process files; GitHub reports this head mergeable. These completed checks belong to the stated publication head, not a newly rebuilt merge with that later base.

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for four blockers, each with an inline comment:

  1. The selected memcode model is dropped on launches that have no task prompt.
  2. Model confirmation uses a substring match and can pass on the wrong model.
  3. Sessions that share a workspace overwrite each other's context-chunk-N hooks in the shared .memcode/hooks.json.
  4. The 2s hook timeout is too short for the session-start identity POST, which risks unverified identity and a failed restore.

The other inline comments are non-blocking.

Also non-blocking (not part of the diff, so no inline comment): session_manager/manager.go:3293 restore copies rec.Metadata.Model into agentConfig.Model without the memcode catalog filter that effectiveAgentConfig applies at spawn. If a record saved a model memcode doesn't support (e.g. claude-opus-4-1 from another harness), validateModel rejects it in GetLaunchCommand/PrepareNativeRestore and every restore of that session fails. It could fall back to the TUI's own selection instead.

Comment thread backend/internal/cli/hooks.go Resolved
@nikhilachale

Copy link
Copy Markdown
Collaborator Author

Addressed and resolved all nine open review threads in e22e1bc (implementation 20dbf27), with a fix explanation on each thread. Also fixed the additional review-body finding: restore now ignores unsupported saved memcode models instead of rejecting the session, with regression coverage for both unsupported and valid models.

Merged current main and resolved conflicts. All 24 CI checks pass on e22e1bc, including full backend race suites, frontend validation, platform CLI checks, lint and generated-contract drift checks. The updated PR description records local validation limits and the fixed hook-slot startup cost.

The previous native/provider/UI qualification remains incomplete, so the PR remains a draft.

@Prasad-D-Ware Prasad-D-Ware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed against 20dbf2785 (head e22e1bcae). All four blockers from my earlier review are fixed:

  1. Promptless model selection: spawn, fresh restore, and native restore now always go through deliverAfterStartPrompt. An empty prompt is never submitted as a user turn.
  2. Model confirmation: it now compares the full model token from the newest model → line in the styled current viewport, and fails closed when no rendered output is available.
  3. Shared hooks.json: the 64 stable slots no longer depend on any session's chunk count. Each slot reads its own session's atomic instructions.json, and unused slots emit nothing.
  4. Hook timeout: raised to 30s.

The non-blocking items are also addressed: the launch-env endpoint check, removing the synchronous catalog probe, MEMCODE_AUTO_UPDATE=off, the generic catalogSchemaVersions, moving to hooksjson.Manager with flat events and uninstall, dropping the no-op post_tool_use hook, and dropping unsupported saved models on restore. All 24 CI checks pass.

I've left three small non-blocking notes inline.

This approval covers the code changes only. The PR is still a draft, and per the author's own note the native, provider, and UI qualification is still incomplete.

@nikhilachale
nikhilachale marked this pull request as draft October 18, 2026 16:50
@nikhilachale
nikhilachale force-pushed the feat/memcode-tui-harness branch from fd83c6f to 81b023b Compare October 18, 2026 16:54
@nikhilachale
nikhilachale marked this pull request as ready for review October 18, 2026 18:27
@nikhilachale
nikhilachale merged commit 9b81590 into OrchestratorInc:main Oct 18, 2026
24 checks passed
@nikhilachale

nikhilachale commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

Post-merge qualification gap: authenticated Memcode 0.46.0 and actual Electron checks remain unrun.

Merged source 9b81590 has the same tree as reviewed head ad0c14c. All 24 exact-head checks passed (CI checks). The older native-only 0.38.1 receipt does not qualify this source/version.

Remaining live scenarios:

  • Fresh registered-AO task consumes independent private instructions, native project rules and preserved user hooks, verified by separate output witnesses.
  • Exact restore retains full native ID/history and binds the current launch generation while consuming newly changed private instructions. Initial task, follow-up and continuation each execute once, without replay.
  • Promptless worker/orchestrator model confirmation, custom-endpoint inheritance/explicit-override behavior, and missing-history/unverified-identity negative controls. Distinguish strict exact Resume from policy-permitted non-native fresh Restore.
  • Executing-child cancel and active Kill stop delayed effects while an independent control session remains unaffected.
  • Shared-workspace sessions retain independent instruction chunks/user hooks; measure startup/resume hook overhead.
  • Genuine Electron harness/install/auth/model/task/follow-up, cancellation/Kill, archive/restore, Kanban, reconnect and cleanup, with action/result captures and functional witnesses.

Prerequisites: An owner-authenticated Memcode 0.46.0 profile or authorized test host is still needed. No credentials or profile data should be posted. On this Windows host, existing Python 3.12.8 works when explicitly selected, but the pinned native dependency rebuild fails with “Could not find any Visual Studio installation to use.” Compatible Visual C++ build tools and Windows SDK, or another supported buildable host, are required.

Completed non-auth checks: isolated npm ci and source runtime builds; Electron 44.7.0 executes in Node mode (ABI149). No AO window or provider task was run.

Targeted source/CI inspection identified no demonstrated urgent schema/startup or shared-runtime defect. Authenticated native/Electron behavior remains unqualified. No code changes, reopen/revert, or PR state actions were taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/daemon Go daemon, process lifecycle, and backend control plane. enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants