pi-session-mcp 0.7.1 → 0.8.1

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 (66) hide show
  1. package/.pi-session-mcp-cli/config.js +47 -7
  2. package/.pi-session-mcp-cli/doctor.js +75 -2
  3. package/.pi-session-mcp-cli/execution-profile.js +1 -0
  4. package/.pi-session-mcp-cli/override-lock.js +125 -0
  5. package/.pi-session-mcp-cli/setup-platform.js +195 -0
  6. package/.pi-session-mcp-cli/setup-result.js +8 -0
  7. package/.pi-session-mcp-cli/skill-catalog.js +35 -0
  8. package/.pi-session-mcp-cli/skill-customize.js +268 -0
  9. package/.pi-session-mcp-cli/skill-library.js +188 -0
  10. package/CHANGELOG.md +176 -0
  11. package/README.md +15 -3
  12. package/dist/capabilities.d.ts +1 -0
  13. package/dist/capabilities.js +2 -1
  14. package/dist/client-adapters/mcp-verifier.js +6 -2
  15. package/dist/config.d.ts +4 -0
  16. package/dist/config.js +47 -7
  17. package/dist/doctor.d.ts +7 -1
  18. package/dist/doctor.js +75 -2
  19. package/dist/execution-profile.d.ts +4 -0
  20. package/dist/execution-profile.js +1 -0
  21. package/dist/override-lock.d.ts +34 -0
  22. package/dist/override-lock.js +125 -0
  23. package/dist/pi-adapter.d.ts +7 -5
  24. package/dist/pi-adapter.js +1 -0
  25. package/dist/pi-skills.d.ts +17 -0
  26. package/dist/pi-skills.js +64 -0
  27. package/dist/sdk-pi-adapter.d.ts +7 -3
  28. package/dist/sdk-pi-adapter.js +82 -16
  29. package/dist/server.js +1 -0
  30. package/dist/session-registry.d.ts +8 -6
  31. package/dist/session-registry.js +3 -2
  32. package/dist/setup-cli.d.ts +2 -0
  33. package/dist/setup-cli.js +16 -0
  34. package/dist/setup-main.d.ts +1 -1
  35. package/dist/setup-main.js +18 -3
  36. package/dist/setup-ownership.d.ts +9 -0
  37. package/dist/setup-ownership.js +32 -5
  38. package/dist/setup-skills.d.ts +76 -0
  39. package/dist/setup-skills.js +586 -0
  40. package/dist/setup.d.ts +7 -0
  41. package/dist/setup.js +49 -6
  42. package/dist/skill-catalog.d.ts +26 -0
  43. package/dist/skill-catalog.js +35 -0
  44. package/dist/skill-customize.d.ts +41 -0
  45. package/dist/skill-customize.js +268 -0
  46. package/dist/skill-library.d.ts +106 -0
  47. package/dist/skill-library.js +188 -0
  48. package/docs/acceptance.md +593 -1
  49. package/docs/adr/0006-pi-extension-allowlist.md +3 -0
  50. package/docs/adr/0007-profile-skill-selection.md +228 -0
  51. package/docs/architecture.md +10 -6
  52. package/docs/client-setup-design.md +219 -1
  53. package/docs/client-setup.md +86 -3
  54. package/docs/doctor-design.md +9 -1
  55. package/docs/installation.md +128 -5
  56. package/docs/pi-extensions-design.md +28 -4
  57. package/docs/releasing.md +18 -9
  58. package/docs/session-mcp.md +7 -2
  59. package/docs/skills.md +616 -0
  60. package/docs/threat-model.md +19 -2
  61. package/docs/tool-contracts.md +9 -5
  62. package/package.json +2 -1
  63. package/pi-session-mcp.example.json +9 -3
  64. package/skills/pi-session-implementation/SKILL.md +42 -0
  65. package/skills/pi-session-orchestration/SKILL.md +94 -0
  66. package/skills/pi-session-review/SKILL.md +58 -0
@@ -97,7 +97,12 @@ env -i HOME="$DISPOSABLE_HOME" PATH="$PATH" PI_SESSION_MCP_CONFIG="$ACCEPTANCE_C
97
97
  ### Pass criteria
98
98
 
99
99
  - All nine operations report the expected overall status, finding and exit
100
- status.
100
+ status. From the change that tracks #46 on, every operation also reports the
101
+ controller skill finding (`skill_absent` twice, `skill_installed`,
102
+ `skill_already_equivalent`, `skill_verified`, `skill_removed`,
103
+ `skill_installed`, `skill_verified`, `skill_removed`); the skill file exists
104
+ after steps 3 and 7 and is gone after steps 6 and 9; a foreign skill placed
105
+ in the same skill directory stays unchanged throughout.
101
106
  - Steps 1 and 2 leave the client state unchanged.
102
107
  - After step 9 the `pi-session-mcp` registration is absent, the sentinel is still
103
108
  present, and the ownership record set is empty. The ownership directory has
@@ -323,6 +328,236 @@ Manual, on a machine with Pi, `pi-cursor-sdk@0.5.3` and a stored Cursor key. Run
323
328
 
324
329
  Record date, source commit, versions and outcome under Status. No secret, path or prompt content goes into the record.
325
330
 
331
+ ## Multi-session skill acceptance
332
+
333
+ A targeted live check for profile skill selection ([skills](skills.md)) and for
334
+ several Pi sessions that one real controller drives at the same time. It is not
335
+ the ten-task Level 3 cycle and does not replace it.
336
+
337
+ The maintainer script `scripts/multi-session-acceptance.mjs` prepares the run,
338
+ starts the controller and checks the outcome. The controller itself calls the
339
+ Pi Session MCP tools; the script never does.
340
+
341
+ ### Preparation
342
+
343
+ - Candidate: a separate detached checkout of the commit under test, built with
344
+ `npm ci`, `npm run build` and `npm run build:cli`. `prepare` records the
345
+ commit, whether the checkout is clean, the SHA-256 of `dist/main.js` and,
346
+ from the harness of `cc810c9` on, a SHA-256 over every built module in
347
+ `dist/`; `run` refuses a changed build.
348
+ - Configuration: `prepare --base-config <operator config> --from-profile
349
+ <alias>` copies only provider, model and thinking level of the one explicitly
350
+ selected profile into a run configuration with two profiles: `accept-read` (default, `read-only`, skill `review`) and
351
+ `accept-code` (`coding`, skills `implementation` and `handshake`). From the
352
+ harness of `3f98104` on, all three are `builtin:` references: the two worker
353
+ skills ship with the candidate, and the `handshake` skill sits in the
354
+ override directory `skills/` next to the run configuration, so the run also
355
+ exercises library resolution. The `handshake` skill is generated per run and
356
+ holds a random token that no controller prompt contains. A profile with
357
+ `mcpServers` is always rejected. A profile with `extensions` is rejected
358
+ unless `--with-extensions` is given; with it, `prepare` also copies exactly
359
+ that profile's extension allowlist (1 to 8 distinct exact
360
+ `npm:<name>@<version>` pins) into both run profiles and installs nothing.
361
+ `--with-extensions` on a profile without extensions is rejected. Nothing else
362
+ is copied: the run has its own workspaces and skills.
363
+ - Working directory: `--work-dir` (default `~/.cache/pi-session-mcp-acceptance`)
364
+ must not be inside a temporary directory (the system temporary directory,
365
+ `/tmp`, `/var/tmp` or `/dev/shm`), because Codex refuses helper binaries
366
+ there.
367
+ - Fixtures: four small synthetic git repositories per client (`slug`, `stats`,
368
+ `wait`, `range`), each a separate workspace alias (`cc-*` for Claude Code,
369
+ `cx-*` for Codex). Both clients use the same configuration and build.
370
+ - Fixture baselines: when it creates a fixture, `prepare` stores its initial
371
+ commit and a manifest of its files (path, type, mode, SHA-256; without
372
+ `.git/`) under the run's private directory, never inside the worker's
373
+ workspace. `run` refuses a fixture that differs from its baseline before the
374
+ launch.
375
+ - Bound resources: `prepare` records a digest of the candidate build, the
376
+ installed Claude Code controller skill copy, the candidate skill that the
377
+ Codex controller's link points to, the worker skills (`implementation`,
378
+ `review`), the `handshake` skill, the override directory, the run
379
+ configuration, the Claude MCP configuration, the fixture baselines, the
380
+ harness itself, and the `pi-session-orchestration` copies in the operator's
381
+ home (`~/.claude/skills` and `~/.agents/skills`, recorded as missing when
382
+ absent). `run` rechecks all of them before the launch and again after the
383
+ run. A change before the launch refuses the run; a change after it fails the
384
+ result with `resourcesChanged`.
385
+ - Home controller skills: Claude Code prefers a personal skill over a project
386
+ skill of the same name. With `--setting-sources project,local`, as the
387
+ harness starts it, Claude Code `2.1.296` listed only the project copy when a
388
+ different personal copy existed (observed on 2026-10-12 with a marker skill);
389
+ without that flag the personal copy shadowed the project copy. Re-check this
390
+ when the client version changes. Codex's precedence between its home skills
391
+ and the run's repository skill is not established, so a Codex run is refused
392
+ while `~/.agents/skills/pi-session-orchestration` differs from the
393
+ candidate's skill.
394
+ - Launch record and failed analysis: `run` records the launch once before the
395
+ controller starts, so an attempt that ends without a result is never repeated
396
+ silently. If the analysis after the controller fails, the result is recorded
397
+ as `analysisFailed` and never passes, and the run's own processes are still
398
+ terminated. A `SIGINT` or `SIGTERM` that the harness handles during the
399
+ analysis records the result at once as `harnessAborted` and `analysisFailed`,
400
+ keeps the supervision's flags (`timedOut`, `spawnFailed`, `unterminated`),
401
+ terminates the run's recorded processes and exits with 1. A harness that ends
402
+ without handling a signal (for example `SIGKILL`, `SIGHUP` or out of memory)
403
+ writes no result; `evidence` lists its launch as one without a result.
404
+ - Controller skill: from the harness of `3f98104` on, `prepare` installs the
405
+ Claude Code controller skill the way an operator does, with the candidate's
406
+ `pi-session-mcp-setup --apply --target claude-code:project:pi-session-mcp` in
407
+ the controller's directory. The setup step runs with a disposable `HOME`, so
408
+ setup state and client files of that step never touch the real home; it must
409
+ report `applied` and `skill_installed` and leave a regular copy identical to
410
+ the shipped skill. Codex installs skills only in the user's home, which the
411
+ run must not change, so the Codex controller gets one run-scoped symbolic link
412
+ in `.agents/skills` of its directory. Earlier runs linked both. No global
413
+ skill directory changes.
414
+ - Clients: Claude Code runs as `claude -p` with `--mcp-config`,
415
+ `--strict-mcp-config`, `--setting-sources project,local`,
416
+ `--permission-mode dontAsk` and an `--allowedTools` list of the eight tools
417
+ plus read-only file tools, `sleep`, `node --test` and `git -C`. Codex runs as
418
+ `codex exec --ignore-user-config --sandbox read-only` with the server
419
+ defined through `-c mcp_servers.pi-candidate.*` and the three per-tool
420
+ approvals from [client setup](client-setup.md#run-codex-without-prompts).
421
+ Neither run changes a persistent registration, `HOME` or `CODEX_HOME`, and
422
+ both use the existing authentication.
423
+ - Time limit: `run --timeout-min` takes a number above 0 and at most 180
424
+ (default 25). After the limit the harness sends `SIGTERM` to the client's
425
+ process group and waits up to 10 seconds. It then sends `SIGKILL` to that
426
+ group and to the recorded processes of the run whose PID and start time still
427
+ match, never by name. A process that is only found by its working directory
428
+ inside the run is reported, not killed. The run is complete when the client
429
+ exits and a bounded drain of its output has finished; a client that the
430
+ escalation cannot reap still ends the wait and is marked `unterminated`. The
431
+ result classifies `timedOut`, `spawnFailed`, `harnessAborted` (`SIGINT` or
432
+ `SIGTERM` to the harness) and `analysisFailed`; the CLI exits 1 for each of
433
+ them. The original result of a client
434
+ and scenario is written once; a second `run` for the same pair is refused.
435
+
436
+ ### Scenarios
437
+
438
+ Each client runs two invocations, one per scenario:
439
+
440
+ | Scenario | What the controller does | What is checked |
441
+ | --- | --- | --- |
442
+ | `parallel` | Capabilities first; two sessions of `accept-code` on `slug` and `stats`; both first turns started before waiting; one follow-up in the `slug` session that adds a test and completes the handshake from the worker's skills; own verification; close both | Candidate version and configuration fingerprint seen through capabilities; `skills` of `accept-code`; first turns overlap by the server's `startedAt` and `completedAt`; follow-up completed; tests pass and only allowed files changed; handshake file holds the token although no prompt contained it |
443
+ | `abort` | Two sessions on `wait` (a bounded `sleep 120` command) and `range` (a bounded `sleep 45`, then the change); abort `wait` about 15 seconds after both turns started, while `range` runs; verify and close both | Every abort result is `ok` (an `abort_timeout` stays on record even after a retry); the first successful abort comes before `pi_turn_get` shows the `wait` turn `aborted`, and both before its session is closed; its abort time lies inside the running interval of `range`; `range` completed and verified; at the end of the run no late file exists and no worker `sleep` remains |
444
+
445
+ ### Independent checks
446
+
447
+ - The script watches `/proc` during the run and records every process of the
448
+ controller tree, every server of this run (entry point and configuration
449
+ path) and every process whose working directory lies inside the run, by PID
450
+ and start time. A later sighting of a process never lowers its role or drops
451
+ its fixture: an exiting server, or a zombie its client has not reaped yet,
452
+ has no command line, environment or working directory left to read, and a
453
+ descendant that outlives the client keeps the ownership that makes it the
454
+ run's own to terminate. After the controller exits and the server's
455
+ 15-second shutdown bound has passed, none of them may remain.
456
+ - From the controller transcript it extracts only tool names, aliases, states,
457
+ timestamps and counts. It scans every Pi Session MCP result, with
458
+ `assistantText` removed, for local paths, the token and credential markers,
459
+ and counts mentions in `assistantText` separately.
460
+ - Scope: after the controller exits, each fixture is compared with its
461
+ baseline in three independent ways: the working tree against the manifest
462
+ (including untracked, ignored, deleted, renamed and mode-changed files), the
463
+ index against the base commit, and `HEAD` against the base commit. A change
464
+ that a worker committed therefore counts. The union of changed paths must lie
465
+ inside the files allowed for that task. A missing or unreadable baseline,
466
+ `.git` or base commit fails the check; it is never read as clean. Git runs
467
+ pinned to the fixture with hooks and `fsmonitor` switched off.
468
+ - Business checks: besides the fixture's own `node --test`, the harness runs
469
+ its own cases per fixture (`slug`, `stats`, `range`) against the worker's
470
+ module in a separate `node` process, because a worker could have edited the
471
+ tests it is judged by. For `stats` one case passes a frozen input array, so
472
+ an implementation that sorts its input in place fails. The fixture's tests
473
+ and the business checks must both pass.
474
+ - Every changed file must have been last written during a worker turn of its
475
+ task's session, and `HANDSHAKE.txt` during the follow-up turn, by the
476
+ server's turn timestamps. This catches a write outside the worker turns, not
477
+ one during them.
478
+ - Acceptance verdict: each result carries `acceptance` with `passed` and a
479
+ list of `failures`, computed mechanically from the checks. `passed` is true
480
+ only when the list is empty. A failure code is listed when any of these
481
+ does not hold:
482
+ - the controller exit code is 0 (`controllerExit`), neither `timedOut`,
483
+ `spawnFailed` nor `harnessAborted` is set, and the analysis finished
484
+ (`analysisFailed`);
485
+ - no bound resource changed after the run (`resourcesChanged`), and for a
486
+ reanalysis no resource or fixture differs from the state recorded at the
487
+ end of the run (`stateChangedSinceRun`);
488
+ - at least one server of the run was observed (`noServerObserved`) and no
489
+ process of the run remains (`residualProcesses`);
490
+ - the controller called `pi_capabilities_get` first (`capabilitiesNotFirst`),
491
+ saw the candidate version and configuration fingerprint
492
+ (`candidateNotConfirmed`) and saw exactly the skills `implementation` and
493
+ `handshake` on `accept-code` (`workerSkills`);
494
+ - the structural leak scan found nothing (`structuralLeaks`), the token
495
+ appears nowhere it must not (`tokenExposed`), and no worker prompt or
496
+ controller action touched a private marker (`privateAccess`);
497
+ - at least two sessions started and all were closed (`sessionsNotClosed`);
498
+ - `parallel`: both first turns completed (`firstTurnsNotCompleted`), they
499
+ overlapped (`noOverlap`) and the follow-up completed
500
+ (`followUpNotCompleted`);
501
+ - `abort`: the `wait` turn ended `aborted` after only successful aborts
502
+ (`abortFailed`), in the required order and before its session closed
503
+ (`abortOrder`), and `range` completed with the abort inside its running
504
+ interval (`neighborNotRunningDuringAbort`);
505
+ - per fixture: only allowed changes (`<task>:changes`), every change written
506
+ during a worker turn (`<task>:attribution`), fixture tests and business
507
+ checks passing (`<task>:tests`), for `slug` the added test and the
508
+ handshake (`slug:followUp`), for `wait` no late file (`wait:lateFile`),
509
+ and an oracle for every task of the scenario (`oracleMissing`).
510
+ - Liveness observation: for each turn of a session, `turnLiveness` records the
511
+ number of `pi_turn_get` polls that saw the turn `running` and whether
512
+ `updatedAt` exceeded `startedAt` while it was running. This is an
513
+ observation, not a pass criterion.
514
+ - Controller writes are limited by the client restrictions: the Codex
515
+ controller runs in a read-only sandbox, and the Claude Code controller has no
516
+ write or edit tool, although its allowed `git -C` could still change a
517
+ fixture.
518
+ - The handshake token must appear neither in a worker prompt nor anywhere in
519
+ the controller transcript, and no worker prompt may name a private path or a
520
+ skill file. The controller's own reads and commands must not name the run's
521
+ private directory or its files; this is a marker check, not a sandbox.
522
+ - The harness records its own SHA-256 at `prepare` and refuses to run or
523
+ re-evaluate a run with another version.
524
+ - `reanalyze` recomputes the transcript analysis and the checks of a finished
525
+ run and never overwrites the original result: it writes a numbered
526
+ reanalysis file. At the end of each run the harness records the state of
527
+ the fixtures (working tree, `HEAD`, index) and of the bound resources. If a
528
+ fixture or a bound resource differs from that state, the reanalysis fails
529
+ with `stateChangedSinceRun`.
530
+ - `evidence` writes one sanitized JSON record and refuses to write a local path
531
+ or the token. It lists the original results and the reanalyses separately,
532
+ lists every launch with whether it left a result, and includes the extension
533
+ names and versions and the resource digests.
534
+ Transcripts and the configuration stay in the run's private directory and
535
+ are never published.
536
+
537
+ A controller that reports success does not count; only the checks above and
538
+ the `acceptance` verdict derived from them do.
539
+ If a client or its authentication is not available, record that client's part
540
+ as blocked.
541
+
542
+ ### Method limits of earlier records
543
+
544
+ Records made with the harness before it was hardened in #53 have these method
545
+ limits, which that change removed:
546
+
547
+ - The scope check used `git status`, which does not show a change that a worker
548
+ had already committed.
549
+ - The business checks ran the fixture tests inside the worker's workspace,
550
+ which a worker could have modified.
551
+ - Only the build, the harness and the bytes of the configuration file (through
552
+ its fingerprint) were bound to the run. The installed controller skill, the
553
+ contents of the selected worker skills and the fixture baselines were not.
554
+ - After the time limit the harness sent `SIGTERM` and then waited for the
555
+ client to close without a bound. A hang would have shown as a hang, not as a
556
+ pass.
557
+
558
+ These limits do not show that any recorded result was wrong. The records stay
559
+ as recorded; a new run gets a new record.
560
+
326
561
  ## Evidence rules
327
562
 
328
563
  - Record only sanitized evidence: statuses, booleans, counts, durations,
@@ -612,3 +847,360 @@ Pi extension live check with the operator's configuration on 2026-10-11:
612
847
  prompt.
613
848
  - Two Cursor sessions completed in parallel.
614
849
  - No process remained, and no foreign line reached the MCP stdout.
850
+
851
+ Profile skill selection (#46) passed a multi-session skill acceptance with Claude
852
+ Code and Codex on 2026-10-12, on Linux (`x64`) with Node.js `26.11.1`, Claude
853
+ Code `2.1.296`, Codex CLI `0.162.1` and Pi SDK `1.1.0`:
854
+ - Candidate: detached checkouts of `bcef6ba` (runs 1 to 3), `a086339` (run 4)
855
+ and `b6cf624` (run 5), each clean and built with `npm ci`, `npm run build`
856
+ and `npm run build:cli`. `dist/main.js` has the same SHA-256 in all five
857
+ runs, `47875d38886528ace6b242df2c6ad79d624c51e330e63c2f401576eadc449ed7`:
858
+ the commits after `bcef6ba` change only the orchestration skill text, the
859
+ acceptance harness and documentation.
860
+ - Level 1 on `bcef6ba`, from the command output of the maintainer's gate run:
861
+ every command exited with `0`. The test run reported
862
+ 40 files, 761 passed and 5 skipped; `npm audit` reported 0 vulnerabilities;
863
+ `npm pack --dry-run` listed the three skills and no harness. The test suite
864
+ passed again on `a086339` with the same counts.
865
+ - Configuration: the same bytes in every run, fingerprint
866
+ `sha256:b754f0f5e4702d81d99183817abb379eeed2fb5733f93373852eb827ec16d687`,
867
+ with the profiles `accept-read` and `accept-code` derived from an OpenAI
868
+ `gpt-6-luna` profile with thinking level `low`, and the fixture aliases
869
+ `cc-slug`, `cc-stats`, `cc-wait`, `cc-range`, `cx-slug`, `cx-stats`, `cx-wait`
870
+ and `cx-range`. Offline Doctor reported no finding for it.
871
+ - Every invocation confirmed the candidate's version and this fingerprint
872
+ through `pi_capabilities_get` as its first call, and saw the skills
873
+ `implementation` and `handshake` on `accept-code`. Exactly one server of the
874
+ run was observed per invocation, and no process of the controller tree, the
875
+ server or the fixtures remained afterwards. No Pi Session MCP result
876
+ contained a local path, the token or a credential marker, and no
877
+ `assistantText` mentioned one.
878
+
879
+ Run 5, on `b6cf624` with the harness of that commit (SHA-256
880
+ `ca851130bbade9f0b2700a43059b7ac3ce349dad40ad2b647133f950a408c719`), passed
881
+ every check of all four invocations:
882
+
883
+ | Client | Scenario | Result |
884
+ | --- | --- | --- |
885
+ | Claude Code | `parallel` | First turns overlapped by 25.1 s; follow-up in the same session completed; both fixtures pass their tests with only the allowed files changed, each last written during a worker turn; `HANDSHAKE.txt` holds the token and was written during the follow-up turn, although no worker prompt contained the token and the token never appeared in the controller transcript; no controller action named the private run directory; both sessions closed |
886
+ | Claude Code | `abort` | First turns overlapped by 23.7 s; one abort, result `ok`; `aborted` seen through `pi_turn_get` before close; the abort fell inside the running interval of the neighbor, which then completed and passes its tests; the worker's `sleep 120` was observed running, and at the end of the run it was gone and had written no file; both sessions closed |
887
+ | Codex | `parallel` | As for Claude Code, with an overlap of 24.8 s |
888
+ | Codex | `abort` | As for Claude Code, with an overlap of 22.4 s |
889
+
890
+ The controllers made 1 to 6 `pi_turn_get` calls per session and waited between
891
+ polls with `sleep`. Each invocation took 93 to 156 seconds. The run's
892
+ transcripts were also checked afterwards against the criteria the harness
893
+ gained after run 5: in both `abort` invocations the first successful abort came
894
+ before the first `aborted` observation, and no worker prompt named a private
895
+ path or a skill file. Run 5 used the harness of `b6cf624`; the head's harness
896
+ adds these two checks and the run-time checksum check, and changes nothing
897
+ else.
898
+
899
+ Earlier attempts on the same build, kept on record:
900
+ - Run 1 (Claude Code only, with the harness of `bcef6ba`, which did not record
901
+ its checksum yet): `parallel` passed
902
+ every check. In `abort` the abort itself passed (result `ok`, `aborted` seen
903
+ before close, the worker's `sleep` ended, no late file), but the neighbor
904
+ turn had completed about three seconds before the abort, so the run shows no
905
+ neighbor that keeps running. The neighbor task now starts with a bounded
906
+ `sleep 45` and the abort comes after about 15 seconds.
907
+ - Run 2: three invocations passed every check. In Codex `parallel` every
908
+ functional check passed, including the handshake written during the
909
+ follow-up turn with a token that no prompt contained, but the controller
910
+ then read the run's private handshake skill to confirm the token. The
911
+ controller prompt now confines reads and commands to the fixtures.
912
+ - Run 3: three invocations passed every check. In Codex `abort` the abort, the
913
+ running neighbor and cleanup passed, but the controller told both workers to
914
+ "follow configured handshake instructions" because capabilities listed a
915
+ `handshake` skill, so both fixtures got an extra `HANDSHAKE.txt`. The
916
+ orchestration skill now says that a listed skill is not a task.
917
+ - Run 4 (`a086339`): three invocations passed every check. The Codex
918
+ `parallel` controller read the fixtures-only rule as excluding its own skill
919
+ directory, worked from `./fixtures`, and stopped after
920
+ `pi_capabilities_get` without starting a session. The rule now allows the
921
+ controller's own skill directory.
922
+
923
+ No run showed a Pi Session MCP defect. The deviations were controller
924
+ behavior and harness wording.
925
+
926
+ This is a targeted check of skill selection and of two concurrent sessions
927
+ per client. It is not the ten-task Level 3 cycle. It covers neither the
928
+ extension profile path live (the automated SDK contract tests cover it), nor
929
+ `read-only` workers, nor more than two concurrent sessions, nor macOS.
930
+
931
+ After the owner asked on 2026-10-12 that skills install without manual linking
932
+ and can be adjusted and extended, the same change gained the skill library,
933
+ `builtin:` references, `--customize-skill` and the controller-skill
934
+ installation through `setup`. Its final candidate `0ebbaa0` passed on
935
+ 2026-10-12, on Linux (`x64`) with Node.js `26.11.1`, Claude Code `2.1.296`,
936
+ Codex CLI `0.162.1` and Pi SDK `1.1.0`:
937
+ - Level 1 on a clean detached checkout: every command exited with `0`. The
938
+ test run reported 43 files, 884 passed and 5 skipped; `npm audit` reported 0
939
+ vulnerabilities; `npm pack --dry-run` listed 125 files with the three skills
940
+ and no acceptance harness. `git diff --check` from `0cb3c60` reported nothing.
941
+ - Level 2 through `scripts/setup-acceptance.mjs` with the setup of that
942
+ checkout: 160 of 160 checks passed. All nine steps passed on all four
943
+ targets, including the controller skill finding of every step, the skill file
944
+ after steps 3 and 7 and its absence after steps 6 and 9, and a foreign skill
945
+ that stayed unchanged. The real client registrations were unchanged, no
946
+ process remained, no report leaked a path, and the build was unchanged.
947
+ Earlier candidates `24ab13d` and `37034dd` of the same change had passed
948
+ Level 2 with 160 of 160 as well, before the review fixes that followed them.
949
+ - Multi-session skill acceptance, run 7, with the harness of that checkout
950
+ (SHA-256 `42d46f86ae617c229568437e6d96c93f965c27778c3e2fde51e1c449ef35fb12`)
951
+ and the dist tree SHA-256
952
+ `957dfac67bf0c3c179bff6584b3bda49bedad2fe1642790537f6790b31f5ef37`:
953
+ - `prepare` installed the Claude Code controller skill with the candidate's
954
+ `setup --apply` for the controller's project scope: `applied` and
955
+ `skill_installed`, a regular copy identical to the shipped skill.
956
+ - The configuration (fingerprint
957
+ `sha256:b8a341c9ff48ecd7c02f8959b8e4e696f305431945b659ea35d2d98485e948c3`)
958
+ referenced all three skills with `builtin:`: the two shipped worker skills
959
+ and the `handshake` skill from the override directory next to it.
960
+ - All four invocations passed every check: Claude Code `parallel` (first
961
+ turns overlapped by 21.5 s) and `abort` (22.1 s), Codex `parallel` (22.9 s)
962
+ and `abort` (18.9 s). In both `parallel` invocations the worker wrote the
963
+ handshake token, which existed only in the override-directory skill,
964
+ during the follow-up turn. In both `abort` invocations the one abort
965
+ returned `ok`, came before the `aborted` observation and fell inside the
966
+ running neighbor, which completed and passed its tests. No process
967
+ remained, and no result leaked a path, the token or a credential marker.
968
+ - Run 6 on `cc810c9`, before the last review fixes, had passed every check of
969
+ all four invocations with the same configuration fingerprint and the
970
+ setup-installed Claude Code skill.
971
+
972
+ These runs do not cover macOS, Codex skill discovery from the user's home
973
+ (setup installs it there, and Level 2 checks the file, but no live Codex
974
+ controller read it from there), the extension profile path live, or more than
975
+ two concurrent sessions.
976
+
977
+ The multi-session runs above were made with the earlier harness. Its
978
+ [method limits](#method-limits-of-earlier-records) apply to them. They do not
979
+ show that any of these results was wrong.
980
+
981
+ Before its release, `v0.8.0` passed Level 1 and the working-tree Level 2 on
982
+ its release candidate `6d197a0` on Linux (`x64`), with Node.js `26.11.1`, Codex
983
+ CLI `0.162.1` and Claude Code `2.1.296`, on 2026-10-12:
984
+ - Level 1: every command exited with `0`.
985
+ - The test run reported 43 files, 884 passed and 5 skipped.
986
+ - `npm audit` and `npm audit --omit=dev` reported 0 vulnerabilities.
987
+ - `npm pack --dry-run` listed 125 files, including the three skills.
988
+ - Doctor reported `packageVersion` `0.8.0`. With the example
989
+ configuration its only finding was the missing placeholder workspace.
990
+ - Level 2 ran through `scripts/setup-acceptance.mjs` on the candidate's
991
+ working tree: 160 of 160 checks passed. All nine steps passed on all four
992
+ targets, including the controller skill finding of every step. The real
993
+ client registrations were unchanged, no process remained, and the built
994
+ files were unchanged.
995
+ - Apart from the version, the candidate's sources equal the merge of #48,
996
+ whose final candidate `0ebbaa0` passed the multi-session skill acceptance
997
+ recorded above.
998
+
999
+ After its release, `v0.8.0` passed Level 1 on a fresh clone of its tag and
1000
+ Level 2 in three variants. The release was published on 2026-10-12. The release
1001
+ notes do not date the individual checks, and they name no operating system for
1002
+ the local runs.
1003
+ - Source and tag: the release source and the annotated tag target is
1004
+ `de46896a6cc3aebc61234917c6d8c472003da36b`, the merge of #49 (head
1005
+ `805162ed3c3bcd73113dccabf62656414e3dd9be`). The annotated tag object is
1006
+ `a198292fab7f4ef9bdbd18a0ba40324e45e71e21`. The feature pull request #48
1007
+ (head `a2dc018a22ffa8dd8ff6af5d358f4f57cf7db845`) was merged as
1008
+ `f9e4b6711e9ca0419b2325bec8d6c350ebead5f5`.
1009
+ - CI: #48 and #49 passed on Linux, macOS 15 and macOS 26. The
1010
+ [merged-main run](https://github.com/plagor44-ux/pi-session-mcp/actions/runs/38226706157)
1011
+ and the
1012
+ [tag run](https://github.com/plagor44-ux/pi-session-mcp/actions/runs/38226900880)
1013
+ are on record.
1014
+ - Level 1 on a fresh clone of the tag, with Node.js `26.11.1` and npm
1015
+ `12.2.0`: every command exited with `0`.
1016
+ - Typecheck, server build and CLI build.
1017
+ - The test run reported 43 files, 884 passed and 5 skipped (macOS-only).
1018
+ - `npm audit` and `npm audit --omit=dev` reported 0 vulnerabilities.
1019
+ - Offline Doctor reported `packageVersion` `0.8.0`. With the example
1020
+ configuration its only finding was the placeholder workspace.
1021
+ - npm package `pi-session-mcp@0.8.0`, published from a fresh clone of the tag
1022
+ through staged publishing and approved by the maintainer: 125 files, 189.3 kB
1023
+ and the shasum `37f76ab9c3807213b7e6178156992c76f0ff8378`. The tarball
1024
+ downloaded from the registry had the same SHA-1 and SHA-512 integrity.
1025
+ - Level 2 ran through `scripts/setup-acceptance.mjs` in three variants: the
1026
+ working tree of the release candidate, a fresh clone of the tag, and the npm
1027
+ package installed into a temporary prefix. Each passed 160 of 160 checks.
1028
+ - The clients were Codex CLI `0.162.1` (`user`) and Claude Code `2.1.296`
1029
+ (`user`, `project`, `local`), in disposable homes.
1030
+ - Every step also checked the controller skill: installed after apply,
1031
+ verified, removed after rollback and remove, with a foreign skill in the
1032
+ same directory untouched.
1033
+ - The real client registrations were unchanged, no process remained, and the
1034
+ build stayed byte-identical.
1035
+ - Multi-session skill acceptance: it ran on the branch candidate `0ebbaa0`
1036
+ (recorded above), not on the tag. According to the release notes, its
1037
+ sources equal the release apart from the version and the documentation.
1038
+ Claude Code `2.1.296` and Codex CLI `0.162.1` were the controllers, with Pi
1039
+ SDK `1.1.0` workers. Both the `parallel` scenario (overlapping turns, a
1040
+ same-session follow-up and a skill-only token written by the worker) and the
1041
+ targeted `abort` scenario with a neighbor that kept running passed every
1042
+ check for both clients. The Claude Code controller skill was installed with
1043
+ `setup --apply`, and all catalog skills were `builtin:` references.
1044
+
1045
+ This record does not cover:
1046
+ - A full ten-task Level 3 cycle. The multi-session check is targeted.
1047
+ - A Codex controller that reads the skill from `~/.agents/skills` live (setup
1048
+ installs it there and Level 2 checks the file), the extension profile path
1049
+ live with skills (the SDK contract tests cover it), more than two concurrent
1050
+ sessions, and macOS beyond CI.
1051
+ - The contents of skill files: they are not snapshotted, so skill files must
1052
+ not change while sessions use them. The model sees skill paths in its system
1053
+ prompt and may repeat them in its answers.
1054
+ - Isolation: skill selection limits the regular skill catalog only. An
1055
+ allowlisted extension stays trusted code, and a `coding` profile is no
1056
+ operating-system sandbox.
1057
+ - Package provenance: the npm package has no provenance attestation, because it
1058
+ was published from the maintainer's machine.
1059
+
1060
+ The post-0.8.0 stabilization (#47 and #50 to #54) passed on 2026-10-12, on
1061
+ Linux (`x64`) with Node.js `26.11.1`, Claude Code `2.1.296`, Codex CLI
1062
+ `0.162.1`, Pi SDK `1.1.0` and `pi-cursor-sdk@0.5.3`:
1063
+ - Candidate: a clean detached checkout of `1e904be`, built with `npm ci`,
1064
+ `npm run build` and `npm run build:cli`. `dist/main.js` has the SHA-256
1065
+ `47875d38886528ace6b242df2c6ad79d624c51e330e63c2f401576eadc449ed7`, and the
1066
+ dist tree the SHA-256
1067
+ `7b16757f9a1a0318247914f56debe79119a3845e1a1debcf1ad371db3a958fce`. The
1068
+ built `dist/` and `.pi-session-mcp-cli/` are byte-identical for every
1069
+ candidate below (`0f7c376`, `06471b5`, `cb6e949` and `1e904be`): the commits
1070
+ after `0f7c376` change only the acceptance harness, its tests and
1071
+ documentation. The commits after `1e904be` change only tests and documentation.
1072
+ - Level 1 on that checkout: every command exited with `0`. The test run
1073
+ reported 50 files, 1035 passed and 6 skipped; `npm audit` and
1074
+ `npm audit --omit=dev` reported 0 vulnerabilities; `npm pack --dry-run`
1075
+ listed 129 files with the three skills and no acceptance harness;
1076
+ `git diff --check` and `git status --short` printed nothing.
1077
+ - Level 2 through `scripts/setup-acceptance.mjs` with the setup of that
1078
+ checkout: 160 of 160 checks passed. All nine steps passed on all four
1079
+ targets. The real client registrations were unchanged, no process remained,
1080
+ no report leaked a path, and the build was unchanged. `06471b5` and
1081
+ `cb6e949` had passed 160 of 160 as well.
1082
+ - Multi-session skill acceptance, run 4, with the harness of that checkout
1083
+ (SHA-256 `e694c9be2779aae164ced0b771db035dac64f136160cc98d2c9e9cf63b629afe`):
1084
+ - `prepare --with-extensions` derived the configuration from the operator's
1085
+ Cursor profile: provider `cursor`, model `composer-2.5`, thinking level
1086
+ `off` and the exact allowlist `npm:pi-cursor-sdk@0.5.3` on both run
1087
+ profiles. Nothing else was copied. Fingerprint
1088
+ `sha256:05a3fb00f9a1bb57b891d4cfe273aa19e1a716c0d17d2d24097e4225dbea4142`.
1089
+ - `prepare` installed the Claude Code controller skill with the candidate's
1090
+ `setup --apply`: `applied` and `skill_installed`, a regular copy identical
1091
+ to the shipped skill.
1092
+ - Every invocation confirmed the candidate and the fingerprint through
1093
+ `pi_capabilities_get` as its first call, saw the skills `implementation`
1094
+ and `handshake` on `accept-code`, and had exactly one server of the run
1095
+ observed. No process remained, no bound resource changed, and no Pi
1096
+ Session MCP result contained a local path, the token or a credential
1097
+ marker.
1098
+ - Both Claude Code invocations, the required part, and Codex `parallel`
1099
+ passed every check. Codex `abort` failed one check (`range:changes`); every
1100
+ other check of it passed.
1101
+
1102
+ | Client | Scenario | Result |
1103
+ | --- | --- | --- |
1104
+ | Claude Code | `parallel` | Passed. First turns of two Cursor sessions overlapped by 20.4 s; follow-up in the same session completed; both fixtures pass their tests and the business checks with only the allowed files changed, each last written during a worker turn; `HANDSHAKE.txt` holds the token and was written during the follow-up turn, although no prompt contained the token |
1105
+ | Claude Code | `abort` | Passed. First turns overlapped by 21.5 s; one abort, result `ok`; `aborted` seen through `pi_turn_get` after the abort and before close; the abort fell inside the running interval of the neighbor, which completed and passes its tests; the worker's `sleep` was observed running, and at the end of the run it was gone and had written no file; both sessions closed |
1106
+ | Codex | `parallel` | Passed, as for Claude Code, with an overlap of 21.1 s |
1107
+ | Codex | `abort` | Failed with `range:changes`. The abort, its order, the running neighbor, cleanup and the neighbor's tests and business checks passed (overlap 19.2 s). The `range` worker also wrote `HANDSHAKE.txt`: the controller's prompt said "Change only src/range.js" and did not mention a handshake, so the Cursor worker applied the `handshake` skill of its profile on its own. The scope check caught it, as intended. This is worker behavior, not a Pi Session MCP defect |
1108
+
1109
+ The controllers made 5 to 7 `pi_turn_get` calls per invocation, and each
1110
+ invocation took 90 to 127 seconds.
1111
+
1112
+ - Turn liveness (#47): in every Cursor turn that a controller polled while it
1113
+ was `running`, `updatedAt` had moved past `startedAt`: 7 of 7 turns in run
1114
+ 4, 31 of 31 in runs 1 to 4. Turns that no poll saw running are not counted.
1115
+ This shows public stream events reaching `updatedAt` before the turn ended.
1116
+ It does not show progress, and work without a public event stays
1117
+ invisible.
1118
+ - Controller skill use, checked in the private transcripts of runs 1, 3 and
1119
+ 4:
1120
+ - Each Claude Code invocation invoked its skill once and loaded the copy
1121
+ that setup had installed for the candidate. A phrase that only the
1122
+ candidate's skill contains appeared, and none from the operator's personal
1123
+ copy in `~/.claude/skills`, which is the 0.8.0 skill. So the personal copy
1124
+ did not shadow the project copy.
1125
+ - Each Codex invocation read the candidate's skill through the run-scoped
1126
+ link with one shell command.
1127
+ - The handshake token, which only the override-directory skill held, shows
1128
+ that the worker skills reached the Cursor sessions.
1129
+
1130
+ Earlier attempts on the same build, kept on record:
1131
+ - Before a reboot, on `0f7c376`:
1132
+ - Level 1 passed, with 1028 tests passed and 6 skipped, and the working-tree
1133
+ Level 2 passed 160 of 160.
1134
+ - Claude Code `parallel` passed every check, with an overlap of 52.2 s.
1135
+ - Claude Code `abort` failed with `sessionsNotClosed`, `abortFailed`,
1136
+ `abortOrder`, `neighborNotRunningDuringAbort` and `range:tests`: neither
1137
+ `pi_session_start` started a session. At that time the operator's Pi agent
1138
+ directory was not writable, because `/home` had run out of Btrfs metadata
1139
+ space. The run directory was on a memory-backed file system and was lost in
1140
+ the reboot, so only the maintainer's summaries remain: there is no evidence
1141
+ file, and the exact start error is not on record.
1142
+ - Run 1 on `0f7c376`, with the harness SHA-256
1143
+ `9135f8d9a3d904172475e2fd0d5fce762613a8683a642b53642167572e02ab91`: all four
1144
+ invocations passed every check. The overlaps were 29.0 s and 22.2 s for
1145
+ Claude Code (`parallel`, `abort`) and 22.8 s and 26.5 s for Codex.
1146
+ - Run 2 on `06471b5`, with the harness SHA-256
1147
+ `d63b03065b28f3714ee2e9f76d722053c835f080b3a6edc96e1aab0031a0eadc`:
1148
+ - Codex `parallel` passed.
1149
+ - The other three invocations failed only with `noServerObserved`, and every
1150
+ other check passed, including the aborts, the running neighbors and the
1151
+ absence of residual processes.
1152
+ - The cause was in the harness. It replaced a process's earlier sighting on
1153
+ every sweep, so a sweep that caught the server while its client was ending
1154
+ it (exiting or an unreaped zombie, with nothing left to read) recorded it as
1155
+ a plain descendant of the client. `cb6e949` keeps the server role.
1156
+ - Run 3 on `cb6e949`, with the harness SHA-256
1157
+ `9f62535c3cb28506595ba72e5bafad772df71f473b4711799724186a946713b9`: Level 2
1158
+ passed 160 of 160, and all four invocations passed every check. The overlaps
1159
+ were 22.8 s and 22.2 s for Claude Code and 24.2 s and 18.6 s for Codex. One
1160
+ `assistantText` in Codex `parallel` named the absolute path of the worker's
1161
+ own `HANDSHAKE.txt`; `assistantText` is the worker's free text, counted
1162
+ separately, and not a structural leak. The two harness commits after it keep
1163
+ a process's ownership across sightings and match the client by PID and
1164
+ start time.
1165
+
1166
+ This record does not cover:
1167
+ - macOS beyond CI, or a ten-task Level 3 cycle.
1168
+ - A Codex controller that reads the skill from a copy setup installed in
1169
+ `~/.agents/skills`, because the run must not change the operator's home.
1170
+ Codex read the candidate's skill through a run-scoped link, and Level 2
1171
+ checks the installed file.
1172
+ - A third concurrent session, a `read-only` worker, or more than two
1173
+ concurrent sessions.
1174
+ - A real crash in the middle of a setup skill update, a real contention of
1175
+ two customization processes outside the tests, and an operating-system
1176
+ signal to the harness during a live analysis. The provider-free tests cover
1177
+ these.
1178
+
1179
+ After its release, `v0.8.0` was installed for the maintainer on Linux: the npm
1180
+ package `pi-session-mcp@0.8.0` in the user's npm prefix, registered for Claude
1181
+ Code. Checked on 2026-10-12:
1182
+ - Offline Doctor reported `packageVersion` `0.8.0` and no finding.
1183
+ - `--verify` for `claude-code:user:pi-session-mcp` reported `mcp_verified`, and
1184
+ `skill_verified` for the controller skill.
1185
+ - Codex has no registration of the server on that machine, so `codex:user` was
1186
+ not part of this installation.
1187
+
1188
+ Before its release, `v0.8.1` passed Level 1 and the working-tree Level 2 on its
1189
+ release candidate `baa6406` on Linux (`x64`), with Node.js `26.11.1`, Codex CLI
1190
+ `0.162.1` and Claude Code `2.1.296`, on 2026-10-12:
1191
+ - Level 1 on a clean detached checkout: every command exited with `0`.
1192
+ - The test run reported 50 files, 1035 passed and 6 skipped.
1193
+ - `npm audit` and `npm audit --omit=dev` reported 0 vulnerabilities.
1194
+ - `npm pack --dry-run` listed 129 files, including the three skills, and no
1195
+ acceptance harness.
1196
+ - Doctor reported `packageVersion` `0.8.1`. With the example configuration
1197
+ its only finding was the placeholder workspace.
1198
+ - Level 2 through `scripts/setup-acceptance.mjs` on the candidate's working
1199
+ tree: 160 of 160 checks passed. All nine steps passed on all four targets,
1200
+ including the controller skill finding of every step. The real client
1201
+ registrations were unchanged, no process remained, and the built files were
1202
+ unchanged.
1203
+ - Apart from the version and documentation, the candidate's sources equal
1204
+ `0c7bad3`. Its built modules have the same dist tree SHA-256
1205
+ (`7b16757f9a1a0318247914f56debe79119a3845e1a1debcf1ad371db3a958fce`) as the
1206
+ final candidate `1e904be` of the multi-session acceptance recorded above.
@@ -3,6 +3,9 @@
3
3
  **Status:** Accepted (2026-10-11). Issue #34. Design:
4
4
  [Pi extensions design](../pi-extensions-design.md).
5
5
 
6
+ Amended by [ADR 0007](0007-profile-skill-selection.md) for skills that extension
7
+ packages ship.
8
+
6
9
  ## Context
7
10
 
8
11
  Embedded sessions loaded no Pi extensions. Providers that exist only as Pi