{{ message }}
Repository navigation
Conversation
sergiou87
added this pull request to stack #22992
October 9, 2026 08:14
This was referenced Oct 15, 2026
sergiou87
force-pushed
the
sergiou87-assisted-commit-transactions
branch
from
October 15, 2026 14:45
d08f99b to
8e8dfea
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Cross-platform ref/index recovery requires human review, and pre-execution cleanup retry remains unresolved.
1 open finding
What changed in this PR
Adds the standalone transaction backend for assisted commits, building on layer 1’s UI foundation without enabling model calls, UI execution, or push.
Changes:
- Captures selected-only snapshots and validates complete commit plans.
- Adds guarded local execution, cancellation, rollback, and resource cleanup.
- Extends hook/message environment support and adds tests and lifecycle documentation.
| File | Description |
|---|---|
| docs/technical/assisted-commit-transactions.md | Documents lifecycle and safety boundaries. |
| app/test/unit/git/assisted-commit-hooks-test.ts | Tests native hooks and failure recovery. |
| app/test/helpers/assisted-commit.ts | Adds transaction test helpers. |
| app/src/models/assisted-commit.ts | Defines snapshot and plan contracts. |
| app/src/lib/hooks/with-hooks-env.ts | Passes captured hook configuration. |
| app/src/lib/hooks/hooks-proxy.ts | Preserves captured Git parameters. |
| app/src/lib/hooks/get-repo-hooks.ts | Supports environment-aware hook discovery. |
| app/src/lib/git/update-ref.ts | Adds guarded ref transactions. |
| app/src/lib/git/owned-file-lock.ts | Tracks lock ownership and cleanup. |
| app/src/lib/git/interpret-trailers.ts | Supports isolated trailer formatting. |
| app/src/lib/git/index.ts | Exports assisted-commit APIs. |
| app/src/lib/git/assisted-commit/state.ts | Tracks private transaction state. |
| app/src/lib/git/assisted-commit/snapshot.ts | Captures frozen selected content. |
| app/src/lib/git/assisted-commit/progress.ts | Defines progress and cancellation controls. |
| app/src/lib/git/assisted-commit/plan.ts | Validates ownership and cumulative trees. |
| app/src/lib/git/assisted-commit/index.ts | Exposes backend lifecycle APIs. |
| app/src/lib/git/assisted-commit/git.ts | Implements isolated Git and integrity helpers. |
| app/src/lib/git/assisted-commit/execute.ts | Executes commits and manages recovery. |
| app/src/lib/git/assisted-commit/error.ts | Defines typed errors and recovery information. |
| app/src/lib/format-commit-message.ts | Supports captured formatting environments. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1067
to
+1070
sergiou87
force-pushed
the
sergiou87-assisted-commit-transactions
branch
2 times, most recently
from
October 16, 2026 11:51
b29f3d4 to
538a13c
Compare
Capture immutable selected-content snapshots and validate complete commit plans before publishing local commits. Materialize cumulative trees in isolated Git state and guard cancellation, hook failure, ref/index ownership, and resource cleanup with explicit recovery capabilities. Keep planner, UI orchestration, and push integration for later layers.
Match exact physical fault targets across Git/native path spellings and directory aliases, and assert injections are exercised. Compare filter cwd/worktree identity instead of short-versus-long directory spellings while preserving quoted paths and persistent filter protocol coverage. Leave production transaction guards and unrelated baseline issues unchanged.
Assert helper termination and actual unsuccessful exit before checking parent-owned HEAD locks. Accept Dugite's numeric failure result on Windows as well as POSIX signal rejection, without swallowing assertions or weakening transaction ownership checks.
sergiou87
force-pushed
the
sergiou87-assisted-commit-transactions
branch
from
October 19, 2026 16:38
538a13c to
a921bb0
Compare
Expose an opaque cleanup-only capability when capture or pre-execution disposal fails, including before a snapshot callback exists. Retain owned temporary-directory identity, reject active or concurrent cleanup, and keep disposal retries idempotent without Git operations. Preserve original failure causes and existing executor recovery tokens; cover lifecycle, ownership and error paths with real-Git tests.
This branch has not been deployed
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.


Description
Layer 2 of 5, stacked on #22971. The base is
sergiou87-assisted-commit-uxatb79922ca5ad766f3bee0cbf13dbfdd8e76e8a35b, which includesdevelopmentatbebc062caafcf818993b9f53397b976d33484231; this PR still targets the preceding layer, notdevelopmentdirectly.docs/technical/assisted-commit-process.mdThis adds the standalone plan-first transaction backend. Desktop captures selected content, validates the entire proposed plan and every cumulative tree, then creates only the planned local commits. Copilot receives opaque snapshot change IDs; it cannot supply executable paths, patches or blobs, and this layer contains no SDK/model calls.
AssistedCommitError.cleanupToken.retryAssistedCommitCleanupretries removal of identity-checked private temporary resources without reading or changing HEAD, the index or working-tree files. Repeated failures retain the same capability; successful cleanup is idempotent. Existing executor rollback/recovery tokens and original failure causes remain intact.Public APIs and lifecycle/support/unsafe cases are documented in
docs/technical/assisted-commit-transactions.md. Original manual commit/staging/parser behavior and layer 1's availability/callback gate remain unchanged. Shared existing helpers only gain optional environment plumbing; unrelated issues already present indevelopmentare not fixed.Scope boundary: backend scaffolding only. The constrained planner belongs to layer 3; AppStore/Dispatcher/UI run/progress/cancel/hook recovery wiring belongs to layer 4; opt-in push/retry belongs to layer 5. No real assisted callback is wired here.
Stack
Merge in order, starting with 1. Each PR builds on the preceding PR.
Validation
corepack yarn --frozen-lockfilecorepack yarn test app/test/unit/git/assisted-commit-cleanup-test.ts app/test/unit/git/assisted-commit-test.ts app/test/unit/git/assisted-commit-hooks-test.ts app/test/unit/git/commit-test.tscorepack yarn test app/test/unit/git/assisted-commit-test.ts app/test/unit/git/assisted-commit-hooks-test.ts app/test/unit/git/commit-test.ts app/test/unit/git/refreshable-credentials-test.ts app/test/unit/account-token-lifecycle-test.ts app/test/unit/accounts-store-test.ts app/test/unit/credential-sessions-test.ts app/test/unit/refresh-token-consumers-test.ts app/test/unit/copilot-sdk-auth-test.ts app/test/unit/stores/copilot-store-credentials-test.ts app/test/unit/ui/commit-message-test.tsx app/test/unit/ui/copilot-animation-test.tsxcorepack yarn testGIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.bareRepository GIT_CONFIG_VALUE_0=all corepack yarn testcorepack yarn lint:fixcorepack yarn lintcorepack yarn tsc --noEmit --pretty falseskipLibCheckrequired.corepack yarn exec -- markdownlint docs/technical/assisted-commit-transactions.md --config .markdownlint.js --rules .markdownlint-rules.jscorepack yarn test:e2e:build:unpackagedgit diff --checkThe four plain-suite bare-fixture failures (three push fixtures and one bare-repository detection fixture) are caused by the CLI-injected
safe.bareRepository=explicitpolicy. They were independently reproduced from an archive of exact pinned parentb79922ca5ad766f3bee0cbf13dbfdd8e76e8a35b, without this layer; the same four parent tests pass with the process-only override. No global or repository configuration was changed. These baseline issues remain out of scope and unfixed. The former dependency declaration conflicts are resolved upstream; the current plain strict TypeScript check passes.There are 155 new real-Git/fault tests beyond the lower layer. Coverage includes partial/full selections and same-file offset/reordering, actual trees/full SHAs/counts and working-tree/index byte equality, binary/rename/delete/new/mode/path/EOL cases, hostile plans, selected versus unselected mutation, cancellation boundaries/in-flight Git, real declined/ignored hooks, unintended hook staging, ref/index interference, unborn/detached/linked worktrees, and repeatable owned-resource cleanup/recovery. Cleanup-specific cases cover capture failures before a snapshot exists, planner/validation/cancellation failures, repeated disposal failures, idempotence, forged capabilities, active-operation exclusion and replaced temporary roots without changing repository content.
Screenshots
Not applicable: this layer changes no UI surface and wires no assisted executor callback.
Release notes
Notes: no-notes