@timurproko/a1 0.2.7-dev.1241 → 0.2.7-dev.1244

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +24 -2
  2. package/bin/cli.js +17 -0
  3. package/dist/app/session-shell/dock-chrome.js +1 -4
  4. package/dist/cli/capabilities.d.ts +2 -0
  5. package/dist/cli/capabilities.js +2 -1
  6. package/dist/cli/dispatch.d.ts +11 -0
  7. package/dist/cli/dispatch.js +22 -6
  8. package/dist/cli/package-messages.js +4 -3
  9. package/dist/cli/session-context.js +18 -1
  10. package/dist/cli/uninstall.d.ts +30 -0
  11. package/dist/cli/uninstall.js +117 -0
  12. package/dist/composition/release-update-observation.js +2 -0
  13. package/dist/composition/session-runtime-registry.d.ts +4 -7
  14. package/dist/composition/session-runtime-registry.js +51 -35
  15. package/dist/foundation/launch-guardian/exit-watcher.js +19 -10
  16. package/dist/foundation/lifecycle/native-claim-gate.d.ts +5 -0
  17. package/dist/foundation/lifecycle/native-claim-gate.js +41 -0
  18. package/dist/foundation/lifecycle/session-claim-lock.d.ts +13 -0
  19. package/dist/foundation/lifecycle/session-claim-lock.js +131 -0
  20. package/dist/foundation/lifecycle/session-repository-context.js +3 -104
  21. package/dist/foundation/release/automatic-update.d.ts +1 -1
  22. package/dist/foundation/release/automatic-update.js +1 -1
  23. package/dist/foundation/release/index.d.ts +1 -1
  24. package/dist/foundation/release/index.js +1 -1
  25. package/dist/foundation/release/update.js +15 -6
  26. package/dist/foundation/resident-tabs/boot-identity.d.ts +6 -0
  27. package/dist/foundation/resident-tabs/boot-identity.js +16 -0
  28. package/dist/foundation/resident-tabs/bounded-host-command.d.ts +2 -0
  29. package/dist/foundation/resident-tabs/bounded-host-command.js +26 -3
  30. package/dist/foundation/resident-tabs/continuity.js +11 -3
  31. package/dist/foundation/resident-tabs/runtime-control.js +2 -1
  32. package/dist/integrations/pi/components/shell-footer-status.js +2 -4
  33. package/dist/integrations/pi/components/shell-shared-facade.d.ts +0 -3
  34. package/dist/integrations/pi/components/shell-shared-facade.js +0 -8
  35. package/dist/native/darwin-arm64/manifest.json +2 -2
  36. package/dist/native/darwin-arm64/process-guardian.node +0 -0
  37. package/dist/native/darwin-arm64/terminal-host.manifest.json +3 -3
  38. package/dist/native/darwin-arm64/terminal-host.node +0 -0
  39. package/dist/native/darwin-x64/manifest.json +2 -2
  40. package/dist/native/darwin-x64/process-guardian.node +0 -0
  41. package/dist/native/darwin-x64/terminal-host.manifest.json +3 -3
  42. package/dist/native/darwin-x64/terminal-host.node +0 -0
  43. package/dist/native/linux-x64/manifest.json +3 -3
  44. package/dist/native/linux-x64/process-guardian.node +0 -0
  45. package/dist/native/linux-x64/terminal-host.manifest.json +3 -3
  46. package/dist/native/linux-x64/terminal-host.node +0 -0
  47. package/dist/native/win32-x64/manifest.json +2 -2
  48. package/dist/native/win32-x64/process-guardian.node +0 -0
  49. package/dist/native/win32-x64/terminal-host.manifest.json +3 -3
  50. package/dist/native/win32-x64/terminal-host.node +0 -0
  51. package/docs/architecture/project-structure.md +2 -0
  52. package/docs/worktree-link-recovery.md +37 -0
  53. package/package.json +6 -3
@@ -9,11 +9,11 @@
9
9
  "architecture": "arm64",
10
10
  "target": "aarch64-apple-darwin",
11
11
  "capability": "supported",
12
- "builtAt": "2026-11-05T07:01:22.443Z",
12
+ "builtAt": "2026-11-06T07:00:26.658Z",
13
13
  "artifact": {
14
14
  "filename": "terminal-host.node",
15
- "sha256": "084c00e2cf786f3a8c92deb5f3c7939b87f8f09e481559001acc96dc38c87349",
16
- "size": 6625792
15
+ "sha256": "b2548f95b9660b11b6d28fb4b35f254cde9940d9d19233517bb70507ffcf76ab",
16
+ "size": 6626528
17
17
  },
18
18
  "entry": {
19
19
  "filename": "dist/foundation/resident-tabs/host-entry.js",
@@ -7,10 +7,10 @@
7
7
  "platform": "darwin",
8
8
  "architecture": "x64",
9
9
  "capability": "supported",
10
- "builtAt": "2026-11-05T06:57:19.328Z",
10
+ "builtAt": "2026-11-06T06:57:12.911Z",
11
11
  "artifact": {
12
12
  "filename": "process-guardian.node",
13
- "sha256": "783a65f0de287a1c02cd5429dbe97bc8633f4cc8a7b92e3e961180b9bdcff814",
13
+ "sha256": "b4d66ed5920c3b2d4ac1cb658fe87549cdad2f81948dbe8cfa698ff6d87162e1",
14
14
  "size": 444248
15
15
  },
16
16
  "provenance": {
@@ -9,11 +9,11 @@
9
9
  "architecture": "x64",
10
10
  "target": "x86_64-apple-darwin",
11
11
  "capability": "supported",
12
- "builtAt": "2026-11-05T07:04:03.142Z",
12
+ "builtAt": "2026-11-06T07:03:27.415Z",
13
13
  "artifact": {
14
14
  "filename": "terminal-host.node",
15
- "sha256": "34a1dc77e44453dd8c60d170577615e228bc091c70c1bd86401be2bc849b105f",
16
- "size": 7213944
15
+ "sha256": "cd1103472889d53e2e039cf7673b2fe6e9e0937234591b1202234d0c1c357d2a",
16
+ "size": 7226904
17
17
  },
18
18
  "entry": {
19
19
  "filename": "dist/foundation/resident-tabs/host-entry.js",
@@ -7,11 +7,11 @@
7
7
  "platform": "linux",
8
8
  "architecture": "x64",
9
9
  "capability": "supported",
10
- "builtAt": "2026-11-05T06:57:04.789Z",
10
+ "builtAt": "2026-11-06T06:56:45.470Z",
11
11
  "artifact": {
12
12
  "filename": "process-guardian.node",
13
- "sha256": "118e5954e3864672bd8482ab7edf419cb27dcdf2533720316979b7f5cc5a53a5",
14
- "size": 491520
13
+ "sha256": "18442075f91a02d22071548c0a2c882c69ee04b2e48e0b1130f23a86c5b258ca",
14
+ "size": 491536
15
15
  },
16
16
  "provenance": {
17
17
  "language": "Rust",
@@ -9,11 +9,11 @@
9
9
  "architecture": "x64",
10
10
  "target": "x86_64-unknown-linux-gnu",
11
11
  "capability": "supported",
12
- "builtAt": "2026-11-05T07:00:29.693Z",
12
+ "builtAt": "2026-11-06T06:59:02.808Z",
13
13
  "artifact": {
14
14
  "filename": "terminal-host.node",
15
- "sha256": "272d4279ceda5baabd5edac6f71b8ede554c0420f5fc7f205c4b4a3072fc4851",
16
- "size": 7997704
15
+ "sha256": "f5abfe9464780c9acdf85dfbf8a0f194bf0355188ab23feaa09cb7df84363088",
16
+ "size": 8010960
17
17
  },
18
18
  "entry": {
19
19
  "filename": "dist/foundation/resident-tabs/host-entry.js",
@@ -7,10 +7,10 @@
7
7
  "platform": "win32",
8
8
  "architecture": "x64",
9
9
  "capability": "supported",
10
- "builtAt": "2026-11-05T06:57:43.401Z",
10
+ "builtAt": "2026-11-06T06:57:32.942Z",
11
11
  "artifact": {
12
12
  "filename": "process-guardian.node",
13
- "sha256": "2414e9a2269c6cb9f0ce275f0ea7b8147b5078be54c4bbc5c53dadb41ddad9f4",
13
+ "sha256": "eb4519e51e5c77a740b9c290e28def2293363675b103a21388532fa73d208893",
14
14
  "size": 402432
15
15
  },
16
16
  "provenance": {
@@ -9,11 +9,11 @@
9
9
  "architecture": "x64",
10
10
  "target": "x86_64-pc-windows-msvc",
11
11
  "capability": "supported",
12
- "builtAt": "2026-11-05T06:59:52.560Z",
12
+ "builtAt": "2026-11-06T06:59:37.419Z",
13
13
  "artifact": {
14
14
  "filename": "terminal-host.node",
15
- "sha256": "919ab8121819cd7bc886d64cb8e4f7a422c7263e2aba0afa51319baef9a05adc",
16
- "size": 7115264
15
+ "sha256": "148523e2ee5648749b4c5b84518e3d120aacf247cdf8620c3fa205df5c960dff",
16
+ "size": 7131136
17
17
  },
18
18
  "entry": {
19
19
  "filename": "dist/foundation/resident-tabs/host-entry.js",
@@ -113,6 +113,8 @@ Passing an absolute `path` to `EnterWorktree` is reserved for a worktree created
113
113
 
114
114
  Inventory is read-only and advisory because another runtime may win a later race. A successful link response confirming the exact canonical worktree is required before planning, implementation, test, or delivery-documentation edits. If inventory or linking fails, reports a live/unverifiable owner, loses a race, or confirms another path, stop task edits and report the blocker; use a separate fresh worktree rather than overriding, unlinking, or recovering that owner. A session resuming an existing delivery or switching streams atomically claims and links the exact worktree before editing it.
115
115
 
116
+ Mutation-gate corruption and transient startup-registration failures have a separate [worktree-link recovery procedure](../worktree-link-recovery.md). Automatic recovery never overrides a live or unverifiable editing claim; ambiguous legacy gates remain protected.
117
+
116
118
  The link acquires a cooperative live-session editing claim and switches bare A1's footer repository context and pull-request discovery. It does not change process or tool cwd, create a Git worktree lock, or register, release, or authorize cleanup. Clean unlink/disposal releases live editing authority; a crashed owner becomes reusable only after exact process death is verified. Repository commands therefore keep an explicit worktree path. The primary worktree stays on `develop` for integration and must not be used for task edits. Do not edit, adopt, move, or remove another session's worktree.
117
119
 
118
120
  An agent that directly chooses a transient file path for a PR/comment body, command payload, captured output, temporary patch/diff, or ad hoc log must place it beneath the linked worktree's exact `.artifacts/` root, never the primary checkout, another worktree, OS temp, home/desktop, or a sibling path. Such scratch remains ignored, unstaged, uncommitted, disposable, non-authoritative, and secret-free. This repository path rule does not relocate storage internally selected by tools, product runtime code, or hermetic tests.
@@ -0,0 +1,37 @@
1
+ # Worktree-link recovery
2
+
3
+ A1 coordinates worktree-claim mutations separately from the editing claims themselves. Recovering a mutation gate never grants permission to take another live agent's worktree or to delete worktree contents.
4
+
5
+ ## Automatic recovery
6
+
7
+ Updated A1 holds an OS lock on the persistent `session-worktree-claims/mutation.authority` file. The OS releases it when the process exits, including a crash. `mutation.lock` is now a persistent directory that blocks older file-lock writers; its `owner.json` is only diagnostic metadata.
8
+
9
+ The next mutation safely recovers abandoned owner/pending metadata after taking native authority. Empty, truncated, NUL-filled, or otherwise malformed metadata does not prevent this recovery. One bounded `recovery.json` records the recovery reason/time, not the original bytes or session contents. A live native holder remains protected. Acquisition waits at most two seconds by default and honors cancellation.
10
+
11
+ If startup registration fails temporarily, the running session retries on its 30-second refresh interval. Slow attempts are coalesced rather than queued indefinitely. Once registration succeeds, retry the explicit worktree link in the same session. Switching an agent's session replaces its publication identity, and disposal drains publication before releasing claims.
12
+
13
+ Inventory remains read-only. It can conservatively show unverifiable status until a mutation has recovered abandoned state; inventory does not perform repair.
14
+
15
+ ## Older lock files and mixed versions
16
+
17
+ An existing regular-file `mutation.lock` belongs to the old protocol. Updated A1 cannot safely prove that no old writer/reclaimer is using it, even if a PID in the file is dead. It therefore retains the file and reports `worktree-legacy-recovery-required` rather than guessing or endlessly reporting generic busy.
18
+
19
+ For this one-time legacy case, stop all older A1 processes normally, move only that exact regular lock file to a backup while they are stopped, then start updated A1. Keep sessions, runtime records, associations, editing claims, Git locks, and worktrees. Reinstalling/downgrading alone does not clear persisted legacy state. Never move the new directory or delete `mutation.authority` while A1 is running.
20
+
21
+ When the old gate is absent, updated A1 initializes its compatibility barrier automatically. Older versions cannot mutate worktree claims after this point: all participating sessions must use the updated version. This intentionally prevents two incompatible mutation protocols from running concurrently. The installed native addon must support the new gate; there is no unsafe PID-file fallback if the addon is missing or outdated.
22
+
23
+ ## Diagnostics
24
+
25
+ | Code | Meaning / next step |
26
+ | --- | --- |
27
+ | `worktree-claim-busy` | A mutation still holds native authority. Retry the link shortly; runtime registration retries automatically. |
28
+ | `worktree-legacy-recovery-required` | Retained old-format gate. Use the stopped-process legacy procedure above. |
29
+ | `worktree-coordination-unavailable` | Missing or outdated native support. Repair/update the A1 installation. |
30
+ | `worktree-coordination-io` | Gate/metadata filesystem access failed. Check permissions and storage availability. |
31
+ | `worktree-coordination-boundary` | Unexpected file type, link, or entry. Retain it for inspection; do not clear the store. |
32
+ | `session-runtime-unavailable` | Runtime registration has not succeeded. Retry after the next refresh and address any specific coordination failure. |
33
+ | `process-inspection-unavailable` / `session-runtime-unverifiable` | Exact process identity cannot be checked. Repair inspection support; no ownership takeover is authorized. |
34
+ | `worktree-active-in-another-session` | Another live agent owns the target. Use a different worktree or have that owner release it. |
35
+ | `worktree-owner-unverifiable` | The editing claim itself is uncertain. Gate recovery cannot make that claim available. |
36
+
37
+ Diagnostics do not expose another session's process identity, session file, transcript, or credentials. The mechanism does not repair arbitrary damaged claim records, change tool cwd, or grant Git/cleanup authority.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timurproko/a1",
3
- "version": "0.2.7-dev.1241",
3
+ "version": "0.2.7-dev.1244",
4
4
  "description": "Standalone terminal workspace for supervised native and managed agents",
5
5
  "type": "module",
6
6
  "privateLaunchContract": "neutral-launch-v1",
@@ -11,6 +11,9 @@
11
11
  "resident-control-v1",
12
12
  "resident-workspace-v1"
13
13
  ],
14
+ "updateCommandContracts": [
15
+ "update-release-v1"
16
+ ],
14
17
  "packageManager": "npm@11.13.0",
15
18
  "bin": {
16
19
  "a1": "bin/cli.js"
@@ -123,7 +126,7 @@
123
126
  "@mariozechner/clipboard": "^0.3.9"
124
127
  },
125
128
  "publication": {
126
- "source": "c3b7a3fd5d44c998b87847f0f79422bdbb459355",
127
- "pullRequest": 865
129
+ "source": "111a66b7e3174dcf876416a0b35f09960526ee93",
130
+ "pullRequest": 868
128
131
  }
129
132
  }