Skip to content

Use the REPL session workspace for Sidekick entries - #979

Merged
taras merged 1 commit into
mainfrom
agent/repl-session-workspace-975-codex-20261021
Oct 22, 2026
Merged

taras merged 1 commit into
mainfrom
agent/repl-session-workspace-975-codex-20261021

Conversation

@taras

@taras taras commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Why

Files the Sidekick creates need to stay with their conversation. Writing components/Greeting.md should make <Greeting /> available to a later entry without an include option or restart.

What changes

Before: Sidekick responses and submitted entries inherited project cwd, and component lookup did not include the session directory.

After: Sidekick responses and their submitted entries start beside the session journals. Relative files stay there, and session components/ follows the invocation's configured component directories in lookup. Manual entries and legacy unmarked entries keep project cwd.

Bootstrap and the Environment/Entries guides teach writing a literal component definition, checking the write's output, inspecting its selected origin and invoking it in a later entry.

How it works

captured project paths + session id
  -> one finalized component search list
  -> validation, entry execution, Syntax and packaged Plan

Sidekick Submit with workspace: true
  -> exact retained entry match
  -> session-owned execution with scoped workspace cwd
  -> existing local records restore acknowledged file results

Placement is matched before cold startup can resume an entry and remains available after Submit reconciliation. Fresh publication and legacy first-message publication establish components/; passive reopening creates nothing. Repository discovery and native agent placement retain the original project context.

Review guide

Start with: packages/cli/tests/repl-sidekick-journey.test.ts, the shipped session component journey.

Then review:

  1. repl-profile.ts and repl/program.ts for captured paths, finalization and cold placement matching.
  2. repl/session.ts and repl/sidekick/owner.ts for validation, entry and held-response cwd ownership.
  3. repl/sidekick/{history,model,admission}.ts and repl/repositories/deno/{provider,files}.ts for compatibility and replay.
  4. The Sidekick guides, specs/repl-spec.md and the corresponding architecture amendments.

Look carefully at: the second cold reopen after reconciliation, replay before live I/O, and checkout routing taking precedence over workspace-only recording.

What must stay true

  • Submitted source and retained identities stay exact. The private optional true marker selects placement; unmarked history keeps its released meaning. Codec, reservation, recovery and source-owner regressions cover this boundary.
  • Cwd belongs to the executing scope. Nested Dir restores it on success, failure and cancellation; manual successors retain project cwd. The ownership journey exercises these transitions.
  • Includes grant no permission or protected-name override. Configured-first selection is shared by validation, execution, Syntax and the actual packaged Plan validator; collision, malformed-definition and denied-write cases cover it.
  • Completed file operations restore historical outcomes before live routing. Workspace-only work takes no Git lease; existing checkout holds remain. Local recorder, process-restart and lifecycle tests cover these rules.

How to verify it

Retained focused receipts apply to signed head 2d3e698cee270a02af2b61b5791779430c9eead8: the tested candidate's patch hash matches the commit. Both original Planner and Architect independently PASS that SHA.

  • Sidekick storage/controls/recovery/journey: 37 suites, 181 steps, zero failures. These exercise the shipped examples, isolated sessions, scoped cwd, compatible placement and passive reopen; they catch stale lookup, wrong destinations and repeated completed work.
  • Retained local operations/records/lifecycle: 9 suites, 76 steps, zero failures. Live-call tripwires across a process restart catch repeated writes, refreshed historical reads and lost workspace coverage.
  • Agent journey/include terminal/model: 18 suites, 67 steps, zero failures. These exercise actual Plan draft validation, include order, protected names and retained source coordinates.
  • Documentation validation completes across one profile. Six targeted placement cases also pass under each of Node and Bun.

These are existing implementation-feedback receipts; this metadata edit runs no tests. Required CI and main-health remain delivery blockers. Main is reported red at the accepted base 00f05aa9678f82fc8aa54c10230313117218523e, tracked by #978. This PR remains a draft and makes no merge-readiness claim.

Scope

Included

  • Session cwd for Sidekick responses/submissions, automatic component lookup, compatible continuation and the shipped teaching journey.
  • Existing local-operation recording extended to marked workspace File reads/writes, File.Delete and Dir ensures on Deno and compiled hosts.
  • Owning documentation and focused regressions.

Intentionally unchanged

  • Refs Use each xmd repl session directory as its workspace #975. Journal relocation and generic component-authoring work remain outside this slice, so the broader story stays open.
  • Manual/legacy cwd, native conversation identity/configuration, permission ceilings and source ownership.
  • Node/Bun recorder availability, public core/ACP/Git APIs, dependencies and release configuration.

New abstractions

  • The private command assembly defers includes-dependent Plan/vocabulary construction until the session id is known, while retaining the captured Agent/Plugin installation. Validation, execution and descriptions consume the resulting profile.
  • Original Submit intents remain in the private projection so placement survives reconciliation. The existing matcher and file-record codecs are reused.
  • Each new abstraction has multiple concrete uses or a clear justification.
  • No speculative functionality is included.

Generated or mechanical changes

Existing profile-only test callers explicitly finalize the captured assembly. Those call-site adjustments are mechanical; the journey, storage, recovery and recorder assertions exercise the behavior. No generated artifacts change.

Risks and limitations

  • Acknowledgements are historical observations, not filesystem snapshots. Physically performed work without an acknowledged result can repeat after interruption.
  • Older strict readers refuse histories containing the new Submit marker. Rolling back the binary does not authorize stripping markers or rewriting history.
  • Cold reads do not repair a missing components directory; a later authorized File write can create its parents. A selected malformed definition refuses rather than falling through.

Scope confirmation

  • Every changed file supports the purpose described above.
  • Unrelated cleanup and formatting changes are excluded.
  • Generated or mechanical changes are clearly identified.
  • The description matches the final diff and test results.

@github-actions

Copy link
Copy Markdown

PR #979: Use the REPL session workspace for Sidekick entries

32 files, +1539 / -234

Scope

🔴 PR has 1773 lines changed. Split into focused PRs.

🟡 1773 lines changed. PRs under 400 receive more thorough review.

🟡 32 files changed. Are all changes related?

Structural

Oxlint structural signals:

  • no-unused-vars ×14: packages/cli/tests/fixtures/repl/issue-883/sidekick-harness.ts, packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts, packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts (+4)
  • no-unnecessary-type-arguments ×3: packages/cli/src/repl/session.ts, packages/cli/src/repl/sidekick/owner.ts
  • no-unnecessary-type-assertion ×2: packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/tests/fixtures/repl/issue-883/sidekick-harness.ts
  • no-empty-function ×1: packages/cli/src/repl-profile.ts

Slop

✅ Slop indicators look low.

Static Analysis

Oxlint: 102 diagnostics across 14 files (15 rules)
Density: 0.066 violations/added-line

no-shadow (29): packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts, packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/src/repl/repositories/deno/provider.ts (+6)
no-floating-promises (22): packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts, packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/tests/fixtures/repl/issue-883/host.ts (+2)
no-unused-vars (14): packages/cli/tests/fixtures/repl/issue-883/sidekick-harness.ts, packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts, packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts (+4)
unbound-method (10): packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts, packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/src/deno-repositories.ts (+3)
no-unsafe-type-assertion (7): packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/tests/fixtures/repl/issue-883/host.ts, packages/cli/tests/fixtures/repl/issue-883/sidekick-harness.ts
no-array-sort (4): packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/src/repl/sidekick/model.ts
consistent-function-scoping (3): packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts, packages/cli/src/repl/session.ts
no-unnecessary-type-arguments (3): packages/cli/src/repl/session.ts, packages/cli/src/repl/sidekick/owner.ts
no-control-regex (2): packages/cli/tests/fixtures/repl/issue-883/mounted-program.ts
no-unnecessary-type-assertion (2): packages/cli/tests/fixtures/repl/issue-883/recovery-phase.ts, packages/cli/tests/fixtures/repl/issue-883/sidekick-harness.ts
no-useless-default-assignment (2): packages/cli/src/repl/program.ts
no-empty-function (1): packages/cli/src/repl-profile.ts
no-unnecessary-type-conversion (1): packages/cli/src/repl/sidekick/controls.ts
no-misused-spread (1): packages/cli/src/repl/sidekick/controls.ts
consistent-return (1): packages/cli/src/repl/program.ts

Correctness

No extraneous code patterns detected.

@taras
taras marked this pull request as ready for review October 22, 2026 02:09
@taras
taras merged commit ab0fe7d into main Oct 22, 2026
84 of 86 checks passed
@taras
taras deleted the agent/repl-session-workspace-975-codex-20261021 branch October 22, 2026 07:28
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.

1 participant