@junghanacs/entwurf 0.18.2 → 0.20.0

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 (77) hide show
  1. package/AGENTS.md +2 -2
  2. package/BASELINE.md +23 -5
  3. package/CHANGELOG.md +415 -0
  4. package/DELIVERY.md +59 -6
  5. package/README.md +43 -12
  6. package/VERIFY.md +10 -2
  7. package/docs/acp-backend-rail.md +9 -1
  8. package/docs/external-mcp-host.md +8 -5
  9. package/docs/setup-clean-host.md +93 -7
  10. package/mcp/entwurf-bridge/dist/mcp/entwurf-bridge/src/index.js +18 -7
  11. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/models.js +3 -3
  12. package/mcp/entwurf-bridge/dist/pi-extensions/lib/acp/overlay.js +6 -2
  13. package/mcp/entwurf-bridge/dist/pi-extensions/lib/mux-fresh-call.js +76 -9
  14. package/mcp/entwurf-bridge/dist/pi-extensions/lib/mux-placement.js +54 -6
  15. package/mcp/entwurf-bridge/dist/pi-extensions/lib/resolve-tmux-session.js +114 -0
  16. package/mcp/entwurf-bridge/src/index.ts +22 -7
  17. package/package.json +2 -2
  18. package/pi-extensions/acp-provider.ts +1 -1
  19. package/pi-extensions/entwurf-control.ts +27 -3
  20. package/pi-extensions/lib/acp/models.ts +3 -3
  21. package/pi-extensions/lib/acp/overlay.ts +6 -2
  22. package/pi-extensions/lib/meta-session.ts +25 -0
  23. package/pi-extensions/lib/mux-fresh-call.ts +98 -11
  24. package/pi-extensions/lib/mux-placement.ts +65 -10
  25. package/pi-extensions/lib/resolve-tmux-session.ts +137 -0
  26. package/run.sh +71 -26
  27. package/scripts/agy-bridge.sh +1 -1
  28. package/scripts/agy-imprint.sh +10 -7
  29. package/scripts/check-acp-carrier-augment.ts +6 -5
  30. package/scripts/check-acp-cortex.ts +41 -0
  31. package/scripts/check-acp-provider-surface.ts +9 -6
  32. package/scripts/check-copilot-birth-hook.ts +3 -1
  33. package/scripts/check-copilot-receive-arm.ts +169 -21
  34. package/scripts/check-copilot-statusline.ts +3 -1
  35. package/scripts/check-fresh-cut-gate.sh +54 -2
  36. package/scripts/check-gate-qualification.ts +13 -12
  37. package/scripts/check-hook-launch-topology.ts +6 -5
  38. package/scripts/check-install-surface.ts +2 -1
  39. package/scripts/check-meta-facts.ts +6 -4
  40. package/scripts/check-meta-hook-session-switch.ts +4 -3
  41. package/scripts/check-meta-identity-consumers.ts +8 -7
  42. package/scripts/check-meta-receiver-marker.ts +2 -1
  43. package/scripts/check-mux-launch-tmux.ts +77 -2
  44. package/scripts/check-mux-launch.ts +17 -0
  45. package/scripts/check-mux-placement-tmux.ts +61 -1
  46. package/scripts/check-mux-placement.ts +33 -0
  47. package/scripts/check-omp-birth-hook.ts +3 -2
  48. package/scripts/check-probe-bridge-command.ts +3 -1
  49. package/scripts/check-setup-qualification.sh +21 -0
  50. package/scripts/copilot-bridge-doctor.sh +15 -5
  51. package/scripts/copilot-bridge-install.sh +6 -2
  52. package/scripts/copilot-launch.sh +16 -2
  53. package/scripts/copilot-receive-bridge.sh +80 -13
  54. package/scripts/lib/reclaim-on-exit.ts +86 -0
  55. package/scripts/meta-bridge-doctor.sh +56 -15
  56. package/scripts/meta-bridge-install.sh +13 -7
  57. package/scripts/meta-bridge-uninstall.sh +6 -4
  58. package/scripts/mutants/acp-cortex.json +26 -2
  59. package/scripts/mutants/copilot-receive.json +26 -0
  60. package/scripts/mutants/fresh-cut.json +26 -0
  61. package/scripts/mutants/mux-boundary.json +24 -0
  62. package/scripts/mutants/mux-fresh-call.json +81 -0
  63. package/scripts/mutants/omp-birth.json +33 -3
  64. package/scripts/mutants/setup-verdict.json +13 -0
  65. package/scripts/omp-bridge-doctor.sh +110 -31
  66. package/scripts/omp-bridge-install.sh +6 -2
  67. package/scripts/omp-receive-install.sh +7 -2
  68. package/scripts/raw-async-delivery/README.md +10 -1
  69. package/scripts/raw-codex-measure/README.md +689 -0
  70. package/scripts/raw-codex-measure/source-audit.md +243 -0
  71. package/scripts/raw-macos-measure/README.md +148 -0
  72. package/scripts/raw-macos-measure/probe.sh +389 -0
  73. package/scripts/smoke-meta-async-drift.sh +7 -5
  74. package/scripts/smoke-meta-install-state.sh +70 -19
  75. package/scripts/smoke-mux-fresh-call-live.ts +175 -3
  76. package/scripts/smoke-omp-bridge-state.sh +43 -2
  77. package/scripts/smoke-setup-verdict.sh +100 -0
package/run.sh CHANGED
@@ -209,7 +209,7 @@ Usage:
209
209
 
210
210
  ./run.sh install-meta-bridge # INTERNAL part of `setup` (native-harness plugin) + doctor recovery path — prefer `setup`; stateful GLOBAL install (plugin + USER MCP + settings keyset, honest uninstall state)
211
211
  ./run.sh uninstall-meta-bridge # 1.0.0 meta-bridge Phase 2: stateful GLOBAL uninstall (restore only keys/items captured in install-state)
212
- ./run.sh doctor-meta-bridge # THE RELEASE ORACLE (#51, Linux-certified repair axis). exit 0 = every required layer was MEASURED on this Linux host: toolchain + state + plugin/MCP + resolved-artifact launch-form classification (all 3 owner hooks + doorbell static contract) + synthetic owner join + store scan + hook errors + SessionStart evidence + REQUIRED live MCP↔marker join + writer-version parity. Missing live evidence is NOT CERTIFIED (open a Claude session and re-run), never a pass; Darwin is not yet verified/certified and stays nonzero for this cut (future validation may reopen it). Detection power is held by check-meta-doctor-oracle
212
+ ./run.sh doctor-meta-bridge # THE RELEASE ORACLE (#51, Linux-certified repair axis). exit 0 = every required layer was MEASURED on this Linux host: toolchain + state + plugin/MCP + resolved-artifact launch-form classification (all 3 owner hooks + doorbell static contract) + synthetic owner join + store scan + hook errors + SessionStart evidence + REQUIRED live MCP↔marker join + writer-version parity. Missing live evidence is NOT CERTIFIED (open a Claude session and re-run), never a pass; Darwin is NOT CERTIFIED and stays nonzero, on ONE narrowed reason — start-key and ppid are portable there (`ps` fallback, same string the TS core mints), so what holds the lane closed is per-process environment DISCOVERY alone, pending physical-host evidence. Detection power is held by check-meta-doctor-oracle
213
213
  ./run.sh copilot [args...] # #82 RAIL 7: the MANAGED Copilot launch. exec()s the vendor CLI in THIS terminal (cwd/pid/exit preserved) with COPILOT_CLI_ENABLED_FEATURE_FLAGS=EXTENSIONS set for that one invocation — entwurf owns no part of your shell and writes nothing to it, but it owns the process it is about to become. Without that flag Copilot skips the extension scan SILENTLY. Refuses to launch unless the receiver unit is actually installed. Injects `--model auto` when no --model was given and `--yolo` when no explicit permission/surface policy flag was given, both BEFORE any `--`; every argument you pass is forwarded byte-identical. RUNNING THIS IS YOUR CONSENT to that profile — use plain `copilot` for stock vendor behaviour. Not tmux, not fresh-call, mints no citizen (birth is still the first prompt)
214
214
  ./run.sh install-copilot-bridge # #82: GLOBAL install of the Copilot BIRTH plugin (own marketplace root; node+entry baked into the no-argv exec string). MCP wiring and the RECEIVER extension are separate install surfaces (install-copilot-mcp, install-copilot-receive). Also retires the stale Claude unit (--keep-stale-claude-unit opts out)
215
215
  ./run.sh uninstall-copilot-bridge # #86 C3a: honest inverse of install-copilot-bridge from the package-owned install-state (exact qualified id + exact marketplace name/path + recorded assembly only; state deleted LAST; a failing vendor list is UNKNOWN and refuses; never --force, never the stale Claude unit)
@@ -2667,8 +2667,8 @@ check_acp_provider_surface() {
2667
2667
  # provider lib modules AND compiles + drives the REAL entry against a fake pi,
2668
2668
  # asserting: one surface name, the no-auth sentinel shape, full
2669
2669
  # ProviderModelConfig rows on the curated claude anchor, the EXACT curated model
2670
- # set both adapters contribute (claude 2 + cortex 4 —
2671
- # [QK:CORTEX-PROVIDER-SIX-ROW-SURFACE], the claim that catches an entry which
2670
+ # set both adapters contribute (claude 3 + cortex 4 —
2671
+ # [QK:CORTEX-PROVIDER-EXACT-ROW-SURFACE], the claim that catches an entry which
2672
2672
  # silently drops a whole backend), and that streamSimple is the real
2673
2673
  # streamShellAcp backend (checked BY NAME, never invoked — invoking spawns an
2674
2674
  # ACP child). Pure, no pi runtime, no API.
@@ -3564,6 +3564,7 @@ _check_pack_install_impl() {
3564
3564
  local loader_ids loader_expected
3565
3565
  loader_ids=$(awk '$1 == "entwurf" { print $2 }' <<<"$loader_out" | LC_ALL=C sort)
3566
3566
  loader_expected=$(printf '%s\n' \
3567
+ claude-fable-5-1 \
3567
3568
  claude-opus-5 \
3568
3569
  claude-sonnet-5 \
3569
3570
  cortex-auto \
@@ -3571,7 +3572,7 @@ _check_pack_install_impl() {
3571
3572
  cortex-claude-sonnet-5 \
3572
3573
  cortex-openai-gpt-5.4 | LC_ALL=C sort)
3573
3574
  if [ "$loader_ids" != "$loader_expected" ]; then
3574
- fail "[check-pack-install] installed provider model set drifted — expected exactly 6 curated ids (claude 2 + cortex 4):"
3575
+ fail "[check-pack-install] installed provider model set drifted — expected exactly 7 curated ids (claude 3 + cortex 4):"
3575
3576
  echo " expected:" >&2
3576
3577
  echo "$loader_expected" | sed 's/^/ /' >&2
3577
3578
  echo " actual (entwurf rows):" >&2
@@ -3582,8 +3583,8 @@ _check_pack_install_impl() {
3582
3583
  fi
3583
3584
  # Name the set on SUCCESS too, not only in the failure branch — same principle as
3584
3585
  # the pinned-pi version assert above: a gate that cannot name what it proved has
3585
- # proved nothing, and "6 rows" without the ids cannot be audited from a CI log.
3586
- echo "[check-pack-install] pi loader smoke pass (entwurf registered; exact 6-row curated set: claude 2 + cortex 4):"
3586
+ # proved nothing, and a row COUNT without the ids cannot be audited from a CI log.
3587
+ echo "[check-pack-install] pi loader smoke pass (entwurf registered; exact curated set: claude 3 + cortex 4):"
3587
3588
  echo "$loader_ids" | sed 's/^/ /'
3588
3589
 
3589
3590
  # npm-managed neutral install regression — the README's PRIMARY install path is
@@ -4815,6 +4816,44 @@ setup_result() { # $1=component $2=PASS|SKIP|FAIL $3=detail
4815
4816
  esac
4816
4817
  }
4817
4818
 
4819
+ # ── platform rail certification (#78 D1) ─────────────────────────────────────
4820
+ # ONE place answers "are entwurf's HARNESS RAILS certified on this platform?".
4821
+ # Every detected-harness branch in setup_all asks it through setup_harness_result
4822
+ # below instead of re-deciding it per backend — a verdict that is honest for one
4823
+ # harness and cosmetic for the next is its own defect, not half a fix.
4824
+ #
4825
+ # Today the answer is Linux and nothing else, and that is an EVIDENCE fact, not a
4826
+ # taste: every shipped rail proves live ownership by reading the per-process
4827
+ # ENVIRONMENT of live harness children, no portable Darwin equivalent has been
4828
+ # MEASURED, and BASELINE.md/README record each rail as `NOT CERTIFIED — pending
4829
+ # physical host`. The harness doctors own that axis and refuse on Darwin.
4830
+ #
4831
+ # What moves this line: a physical-host receipt — a real harness doctor exiting 0
4832
+ # on that platform, recorded in BASELINE.md. A green INSTALLER never moves it;
4833
+ # installation portability and rail/runtime support are separate evidence axes
4834
+ # (Hard Rule 17). Do not widen this to make a CI job green.
4835
+ harness_rail_certified_platform() {
4836
+ [ "$(uname -s)" = "Linux" ]
4837
+ }
4838
+
4839
+ # setup_harness_result — the verdict for a detected harness unit whose INSTALL
4840
+ # COMPLETED. It exists because "the wiring was written" and "the rail works here"
4841
+ # are two different facts and setup measures only the first: setup runs no doctor
4842
+ # (that is the doctor commands' own job). On a platform whose rails carry no
4843
+ # receipt a completed install is therefore a detected-but-INCOMPLETE integration,
4844
+ # which Hard Rule 17 names non-green rather than cosmetic success. setup_result
4845
+ # has exactly three verdicts, so FAIL IS that named non-green — and the detail
4846
+ # must say so in the operator's own words: nothing failed to install, the rail is
4847
+ # simply uncertified here. The wording stays deliberately distinct from the
4848
+ # install-failure FAIL each branch keeps for a real refusal.
4849
+ setup_harness_result() { # $1=component $2=what got wired $3=doctor owning the rail axis
4850
+ if harness_rail_certified_platform; then
4851
+ setup_result "$1" PASS "$2 — verify: $3"
4852
+ return 0
4853
+ fi
4854
+ setup_result "$1" FAIL "$2 — the wiring WAS written and nothing failed to install, but this harness rail is NOT CERTIFIED — pending physical host on $(uname -s). setup runs no doctor; the rail axis is owned by '$3', which refuses on this platform. Tracking: #78."
4855
+ }
4856
+
4818
4857
  # Installed-vs-source is decided by PACKAGE LOCATION — the same `*/node_modules/*`
4819
4858
  # seam run_ts and the bridge launcher already branch on — never by which of
4820
4859
  # pnpm/pi happens to be missing (an accidental failure is not a mode gate).
@@ -4955,7 +4994,7 @@ setup_all() {
4955
4994
  if ! pi_version_in_range "${pi_ver:-0}" "$pi_range"; then
4956
4995
  setup_result pi FAIL "detected pi ${pi_ver:-<unreadable version>} is outside the supported range $pi_range — Pi wiring not written; align pi, then re-run setup"
4957
4996
  elif (install_local_package "$project_dir"); then
4958
- setup_result pi PASS "project + user-scope wiring complete (pi $pi_ver in $pi_range) — verify: ./run.sh doctor-pi-provider"
4997
+ setup_harness_result pi "project + user-scope wiring complete (pi $pi_ver in $pi_range)" "./run.sh doctor-pi-provider"
4959
4998
  else
4960
4999
  setup_result pi FAIL "pi wiring did not complete (see above) — repair, then re-run setup"
4961
5000
  fi
@@ -4965,16 +5004,20 @@ setup_all() {
4965
5004
  # setup ALSO wires the native-harness meta-bridge so a relocate/clone needs ONE
4966
5005
  # command. Detection-gated ("있으면 설정, 없으면 담아준다");
4967
5006
  # meta-bridge-install.sh is idempotent and enforces the Claude floor + its own
4968
- # named prerequisites itself, so a below-floor or refused host lands here as a
4969
- # detected FAIL, never a cosmetic green. CLAUDE_BIN pins the probe for the
4970
- # hermetic smoke; production leaves it unset.
5007
+ # named prerequisites itself, so a below-floor host lands here as a detected
5008
+ # FAIL. It no longer REFUSES ON PLATFORM NAME (0.20.0 opened Darwin: the
5009
+ # installer's own mechanism is portable), so the other half of that old
5010
+ # guarantee — "never a cosmetic green" — is now carried by setup_harness_result:
5011
+ # an install that completes where the RAIL has no receipt is the named
5012
+ # non-green, never a PASS pointing at a doctor that would refuse. CLAUDE_BIN
5013
+ # pins the probe for the hermetic smoke; production leaves it unset.
4971
5014
  local claude_bin="${CLAUDE_BIN:-claude}"
4972
5015
  if ! command -v "$claude_bin" >/dev/null 2>&1; then
4973
5016
  setup_result claude SKIP "claude not on PATH — zero meta-bridge wiring written"
4974
5017
  else
4975
5018
  section "meta-bridge install (native harness detected: Claude Code)"
4976
5019
  if (cd "$REPO_DIR" && bash scripts/meta-bridge-install.sh); then
4977
- setup_result claude PASS "meta-bridge wired — verify: ./run.sh doctor-meta-bridge"
5020
+ setup_harness_result claude "meta-bridge wired" "./run.sh doctor-meta-bridge"
4978
5021
  else
4979
5022
  setup_result claude FAIL "detected Claude Code, but the meta-bridge integration did not complete (see above) — repair, then re-run setup"
4980
5023
  fi
@@ -5017,19 +5060,19 @@ setup_all() {
5017
5060
  else
5018
5061
  agy_rc=0; wire_agy_bridge || agy_rc=$?
5019
5062
  if [ "$agy_rc" -eq 0 ]; then
5020
- setup_result agy-bridge PASS "MCP bridge wired — verify: ./run.sh doctor-agy-bridge"
5063
+ setup_harness_result agy-bridge "MCP bridge wired" "./run.sh doctor-agy-bridge"
5021
5064
  else
5022
5065
  setup_result agy-bridge FAIL "detected agy, but the MCP bridge integration did not complete (reason above) — repair, then re-run setup"
5023
5066
  fi
5024
5067
  agy_rc=0; wire_agy_statusline || agy_rc=$?
5025
5068
  if [ "$agy_rc" -eq 0 ]; then
5026
- setup_result agy-statusline PASS "statusLine wired — verify: ./run.sh doctor-agy-statusline"
5069
+ setup_harness_result agy-statusline "statusLine wired" "./run.sh doctor-agy-statusline"
5027
5070
  else
5028
5071
  setup_result agy-statusline FAIL "detected agy, but the statusLine integration did not complete (reason above) — repair, then re-run setup"
5029
5072
  fi
5030
5073
  agy_rc=0; wire_agy_hooks || agy_rc=$?
5031
5074
  if [ "$agy_rc" -eq 0 ]; then
5032
- setup_result agy-hooks PASS "birth imprint wired — verify: ./run.sh doctor-agy-hooks"
5075
+ setup_harness_result agy-hooks "birth imprint wired" "./run.sh doctor-agy-hooks"
5033
5076
  else
5034
5077
  setup_result agy-hooks FAIL "detected agy, but the birth-imprint integration did not complete (reason above) — repair, then re-run setup"
5035
5078
  fi
@@ -5053,13 +5096,13 @@ setup_all() {
5053
5096
  section "copilot units (native harness detected: GitHub Copilot CLI)"
5054
5097
  copilot_rc=0; (cd "$REPO_DIR" && bash scripts/copilot-bridge-install.sh) || copilot_rc=$?
5055
5098
  if [ "$copilot_rc" -eq 0 ]; then
5056
- setup_result copilot-birth PASS "birth plugin installed — verify: ./run.sh doctor-copilot-bridge"
5099
+ setup_harness_result copilot-birth "birth plugin installed" "./run.sh doctor-copilot-bridge"
5057
5100
  else
5058
5101
  setup_result copilot-birth FAIL "detected copilot, but the birth plugin install did not complete (see above) — repair, then re-run setup"
5059
5102
  fi
5060
5103
  copilot_rc=0; (cd "$REPO_DIR" && bash scripts/copilot-mcp-bridge.sh install) || copilot_rc=$?
5061
5104
  if [ "$copilot_rc" -eq 0 ]; then
5062
- setup_result copilot-mcp PASS "MCP server registered — verify: ./run.sh doctor-copilot-mcp"
5105
+ setup_harness_result copilot-mcp "MCP server registered" "./run.sh doctor-copilot-mcp"
5063
5106
  else
5064
5107
  setup_result copilot-mcp FAIL "detected copilot, but the MCP registration did not complete (see above) — repair, then re-run setup"
5065
5108
  fi
@@ -5077,14 +5120,14 @@ setup_all() {
5077
5120
  else
5078
5121
  copilot_rc=0; (cd "$REPO_DIR" && bash scripts/copilot-receive-bridge.sh install) || copilot_rc=$?
5079
5122
  if [ "$copilot_rc" -eq 0 ]; then
5080
- setup_result copilot-receive PASS "receiver extension installed — verify: ./run.sh doctor-copilot-receive"
5123
+ setup_harness_result copilot-receive "receiver extension installed" "./run.sh doctor-copilot-receive"
5081
5124
  else
5082
5125
  setup_result copilot-receive FAIL "detected copilot, but the receiver extension install did not complete (see above) — repair, then re-run setup"
5083
5126
  fi
5084
5127
  fi
5085
5128
  copilot_rc=0; (cd "$REPO_DIR" && bash scripts/copilot-statusline-bridge.sh install) || copilot_rc=$?
5086
5129
  if [ "$copilot_rc" -eq 0 ]; then
5087
- setup_result copilot-statusline PASS "visible footer wired — verify: ./run.sh doctor-copilot-statusline"
5130
+ setup_harness_result copilot-statusline "visible footer wired" "./run.sh doctor-copilot-statusline"
5088
5131
  else
5089
5132
  setup_result copilot-statusline FAIL "detected copilot, but the visible-footer integration did not complete (see above) — repair, then re-run setup"
5090
5133
  fi
@@ -5107,13 +5150,13 @@ setup_all() {
5107
5150
  section "omp units (native harness detected: oh-my-pi)"
5108
5151
  omp_rc=0; (cd "$REPO_DIR" && bash scripts/omp-bridge-install.sh) || omp_rc=$?
5109
5152
  if [ "$omp_rc" -eq 0 ]; then
5110
- setup_result omp-birth PASS "birth extension installed — verify: ./run.sh doctor-omp-bridge"
5153
+ setup_harness_result omp-birth "birth extension installed" "./run.sh doctor-omp-bridge"
5111
5154
  else
5112
5155
  setup_result omp-birth FAIL "detected omp, but the birth extension install did not complete (see above) — repair, then re-run setup"
5113
5156
  fi
5114
5157
  omp_rc=0; (cd "$REPO_DIR" && bash scripts/omp-mcp-bridge.sh install) || omp_rc=$?
5115
5158
  if [ "$omp_rc" -eq 0 ]; then
5116
- setup_result omp-mcp PASS "MCP server registered — verify: ./run.sh doctor-omp-mcp"
5159
+ setup_harness_result omp-mcp "MCP server registered" "./run.sh doctor-omp-mcp"
5117
5160
  else
5118
5161
  setup_result omp-mcp FAIL "detected omp, but the MCP registration did not complete (see above) — repair, then re-run setup"
5119
5162
  fi
@@ -5124,13 +5167,13 @@ setup_all() {
5124
5167
  # shipping a citizen whose tools nobody can call.
5125
5168
  omp_rc=0; (cd "$REPO_DIR" && bash scripts/omp-config-xdev.sh install) || omp_rc=$?
5126
5169
  if [ "$omp_rc" -eq 0 ]; then
5127
- setup_result omp-config PASS "tools.xdev: false written — verify: ./run.sh doctor-omp-mcp"
5170
+ setup_harness_result omp-config "tools.xdev: false written" "./run.sh doctor-omp-mcp"
5128
5171
  else
5129
5172
  setup_result omp-config FAIL "detected omp, but the tools.xdev operator setting did not land (see above) — resolve it, then re-run setup"
5130
5173
  fi
5131
5174
  omp_rc=0; (cd "$REPO_DIR" && bash scripts/omp-receive-install.sh) || omp_rc=$?
5132
5175
  if [ "$omp_rc" -eq 0 ]; then
5133
- setup_result omp-receive PASS "receiver extension installed — verify: ./run.sh doctor-omp-receive"
5176
+ setup_harness_result omp-receive "receiver extension installed" "./run.sh doctor-omp-receive"
5134
5177
  else
5135
5178
  setup_result omp-receive FAIL "detected omp, but the receiver extension install did not complete (see above) — repair, then re-run setup"
5136
5179
  fi
@@ -6202,10 +6245,12 @@ case "$cmd" in
6202
6245
  # XDG data dir ($XDG_DATA_HOME/entwurf/meta-bridge/.assembled — dev clone and
6203
6246
  # installed package alike, never the checkout) and runs marketplace add +
6204
6247
  # install --scope user, so every native Claude Code session auto-loads it.
6205
- # Idempotent; Linux is the only currently certified axis for the #51 repair cut.
6206
- # Darwin fails loud as not-yet-verified because the strict doctor cannot currently
6207
- # certify its live owner join; future validation may reopen it. Uninstall permits Darwin
6208
- # so an older macOS install is not stranded without an honest inverse.
6248
+ # Idempotent. Install accepts Linux | Darwin the fence that remains inside the
6249
+ # installer is the toolchain check (python3/node/claude presence), not the platform
6250
+ # name. Rail certification stays with doctor-meta-bridge: Darwin is NOT CERTIFIED
6251
+ # pending physical host, reason = per-process environment DISCOVERY. Uninstall
6252
+ # permits Darwin so an older macOS install is not stranded without an honest
6253
+ # inverse.
6209
6254
  (cd "$REPO_DIR" && bash scripts/meta-bridge-install.sh "$@")
6210
6255
  ;;
6211
6256
  uninstall-meta-bridge)
@@ -233,7 +233,7 @@ doctor_static_one() {
233
233
  # entwurf does NOT repair a failed launcher here: it may be owned by a foreign file.
234
234
  log " $label: configured → '$cmd' does NOT serve MCP with its configured args/env$link_note"
235
235
  log " $BOOT_DETAIL"
236
- log " Identify the launcher: command -v '$cmd'; readlink -f \"\$(command -v '$cmd')\""
236
+ log " Identify the launcher: command -v '$cmd'; ls -l \"\$(command -v '$cmd')\""
237
237
  log " If it is entwurf's managed dev link, restore it with ./run.sh expose-dev-bin (it REFUSES a foreign link)."
238
238
  log " If a foreign launcher owns the name, repair/remove it yourself or put a working one earlier on PATH."
239
239
  return 1 ;;
@@ -1,13 +1,16 @@
1
1
  #!/usr/bin/env bash
2
2
  # Stable bin wrapper for Antigravity PreInvocation birth imprint.
3
3
  set -euo pipefail
4
- SELF="${BASH_SOURCE[0]}"
5
- if command -v readlink >/dev/null 2>&1; then
6
- RESOLVED="$(readlink -f "$SELF" 2>/dev/null || printf '%s' "$SELF")"
7
- else
8
- RESOLVED="$SELF"
9
- fi
10
- HERE="$(cd "$(dirname "$RESOLVED")" && pwd)"
4
+ SOURCE="${BASH_SOURCE[0]}"
5
+ while [ -L "$SOURCE" ]; do
6
+ DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
7
+ TARGET="$(readlink "$SOURCE")"
8
+ case "$TARGET" in
9
+ /*) SOURCE="$TARGET" ;;
10
+ *) SOURCE="$DIR/$TARGET" ;;
11
+ esac
12
+ done
13
+ HERE="$(cd -P "$(dirname "$SOURCE")" && pwd)"
11
14
  ROOT="$(cd "$HERE/.." && pwd)"
12
15
 
13
16
  # Node refuses --experimental-strip-types for raw .ts below node_modules. Dev
@@ -31,8 +31,9 @@ import { loadEngraving } from "../pi-extensions/lib/acp/engraving.ts";
31
31
  import { bridgeConfigSignature, contextMessageSignatures } from "../pi-extensions/lib/acp/session-store.ts";
32
32
  import { buildClaudeSessionMeta } from "../pi-extensions/lib/acp/tool-surface.ts";
33
33
  import { ENTWURF_PROJECT_CONTEXT_OPEN_TAG } from "../protocol.js";
34
+ import { reclaimOnExit } from "./lib/reclaim-on-exit.ts";
34
35
 
35
- const tmp = mkdtempSync(join(tmpdir(), "acp-carrier-augment-"));
36
+ const tmp = reclaimOnExit(mkdtempSync(join(tmpdir(), "acp-carrier-augment-")));
36
37
  const REPO_DIR = fileURLToPath(new URL("..", import.meta.url));
37
38
  const BRIDGE_MARK = "operating through entwurf";
38
39
 
@@ -241,8 +242,8 @@ function ctxWith(firstUser: string): Context {
241
242
  // absent → keep it. Home AGENTS.md always survives.
242
243
  // ===========================================================================
243
244
  {
244
- const home = mkdtempSync(join(tmpdir(), "acp-home-"));
245
- const proj = mkdtempSync(join(tmpdir(), "acp-proj-"));
245
+ const home = reclaimOnExit(mkdtempSync(join(tmpdir(), "acp-home-")));
246
+ const proj = reclaimOnExit(mkdtempSync(join(tmpdir(), "acp-proj-")));
246
247
  writeFileSync(join(home, "AGENTS.md"), "HOME-AGENTS-CONTENT");
247
248
  writeFileSync(join(proj, "AGENTS.md"), "CWD-AGENTS-CONTENT");
248
249
 
@@ -295,7 +296,7 @@ function ctxWith(firstUser: string): Context {
295
296
  assert.match(dateLine as string, /^Current date: \d{4}-\d{2}-\d{2}$/, "date is day-granularity only (no clock time)");
296
297
 
297
298
  // > 50KB cwd AGENTS.md → augment truncated with the marker.
298
- const bigHome = mkdtempSync(join(tmpdir(), "acp-big-"));
299
+ const bigHome = reclaimOnExit(mkdtempSync(join(tmpdir(), "acp-big-")));
299
300
  writeFileSync(join(bigHome, "AGENTS.md"), "X".repeat(80 * 1024));
300
301
  const big = buildPiContextAugment({ backend: "claude", cwd: tmp, mcpServerNames: [], homeDir: bigHome });
301
302
  assert.ok(Buffer.byteLength(big, "utf8") <= 50 * 1024, "augment is truncated to the 50KB cap");
@@ -313,7 +314,7 @@ function ctxWith(firstUser: string): Context {
313
314
  // remains an honest fallback; the maintained package prompt must not hit it.
314
315
  // ===========================================================================
315
316
  {
316
- const budgetHome = mkdtempSync(join(tmpdir(), "acp-budget-home-"));
317
+ const budgetHome = reclaimOnExit(mkdtempSync(join(tmpdir(), "acp-budget-home-")));
317
318
  writeFileSync(join(budgetHome, "AGENTS.md"), "H".repeat(12 * 1024));
318
319
  const actual = buildPiContextAugment({
319
320
  backend: "claude",
@@ -323,6 +323,47 @@ const enrichedServers: AcpMcpServer[] = [
323
323
  /absolute realHome/,
324
324
  "a non-absolute realHome must refuse (the child must never re-derive it)",
325
325
  );
326
+ assert.throws(
327
+ () =>
328
+ ensureCortexDualHomeOverlay({
329
+ scopeKey: "pi:sess-empty",
330
+ mcpServers: [],
331
+ realHome: "",
332
+ overlaysRoot,
333
+ isPidAlive: () => true,
334
+ }),
335
+ /absolute realHome/,
336
+ "an empty realHome must refuse — the contract sentence is 'absolute', and '' is not",
337
+ );
338
+ // …and the guard states PATH-FLAVOR absoluteness, not the host it runs on:
339
+ // a drive/UNC realHome is absolute in the win32 flavor, so a POSIX host must
340
+ // NOT read it as relative. (This asserts nothing about native-Windows support
341
+ // — only that the refusal rule is decided by the path, not by process.platform.)
342
+ // realSnowflakeHome is pinned under tmp so the positive cells exercise the
343
+ // GUARD alone: the win32-flavored realHome never reaches a POSIX join for fs
344
+ // work, and every path the overlay materializes stays under overlaysRoot.
345
+ for (const winFlavored of ["C:\\Users\\x", "\\\\server\\share"]) {
346
+ let winOverlay: ReturnType<typeof ensureCortexDualHomeOverlay> | undefined;
347
+ assert.doesNotThrow(
348
+ () => {
349
+ winOverlay = ensureCortexDualHomeOverlay({
350
+ scopeKey: `pi:sess-win-${winFlavored.length}`,
351
+ mcpServers: [],
352
+ realHome: winFlavored,
353
+ realSnowflakeHome: realSnowflake,
354
+ overlaysRoot,
355
+ isPidAlive: () => true,
356
+ });
357
+ },
358
+ `a win32-flavored absolute realHome (${JSON.stringify(winFlavored)}) must PASS the guard — absoluteness is judged by PATH FLAVOR, never by the host the gate runs on [QK:CORTEX-REALHOME-PLATFORM-NEUTRAL]`,
359
+ );
360
+ assert.ok(
361
+ winOverlay !== undefined &&
362
+ winOverlay.scopeDir.startsWith(overlaysRoot) &&
363
+ existsSync(join(winOverlay.snowflakeHome, "cortex")),
364
+ "the accepted win32-flavored realHome must still materialize entirely under the overlays root (the guard is the only thing the flavor cell widens)",
365
+ );
366
+ }
326
367
  } finally {
327
368
  rmSync(root, { recursive: true, force: true });
328
369
  }
@@ -138,19 +138,22 @@ try {
138
138
  // Set comparison (sorted, exact) — not `includes`: a substring/anchor probe
139
139
  // cannot see a row that VANISHED, and the cortex ids contain the claude ids as
140
140
  // substrings. Expected is derived from the two source id constants so there is
141
- // one SSOT; the literal 6 below is the independent floor that catches a
142
- // curation list mutated to empty (which would move expected and captured
143
- // together).
141
+ // one SSOT; the literal 7 below is the independent floor that catches a
142
+ // curation list that SHRANK expected derives from the same constants, so a
143
+ // dropped row moves expected and captured together and the set comparison
144
+ // stays green. That is why the count is asserted separately and carries its
145
+ // own claim: the cortex list has `CORTEX-CURATED-FOUR-ROWS` for exactly this
146
+ // failure, and the claude list needs its own oracle rather than borrowing it.
144
147
  const expectedIds = [...SUPPORTED_ANTHROPIC_MODEL_IDS, ...SUPPORTED_CORTEX_MODEL_IDS].slice().sort();
145
148
  assert.equal(
146
149
  expectedIds.length,
147
- 6,
148
- `curated id constants must total 6 rows (claude 2 + cortex 4) — got ${expectedIds.length}: ${expectedIds.join(", ")}`,
150
+ 7,
151
+ `[QK:CLAUDE-CURATED-THREE-ROWS] curated id constants must total 7 rows (claude 3 + cortex 4) — got ${expectedIds.length}: ${expectedIds.join(", ")}`,
149
152
  );
150
153
  assert.deepEqual(
151
154
  capIds.slice().sort(),
152
155
  expectedIds,
153
- `[QK:CORTEX-PROVIDER-SIX-ROW-SURFACE] compiled entry must register the EXACT curated set of both adapters (claude 2 + cortex 4) — got: ${capIds.join(", ") || "none"}`,
156
+ `[QK:CORTEX-PROVIDER-EXACT-ROW-SURFACE] compiled entry must register the EXACT curated set of both adapters (claude 3 + cortex 4) — got: ${capIds.join(", ") || "none"}`,
154
157
  );
155
158
  assert.equal(typeof cap.cfg.streamSimple, "function", "entry streamSimple must be a function");
156
159
  // Regression guard: the entry must wire the REAL backend (streamShellAcp),
@@ -52,6 +52,7 @@ import { resolveFactList } from "../pi-extensions/lib/entwurf-facts.ts";
52
52
  import { nativePushSupported } from "../pi-extensions/lib/entwurf-v2-contract.ts";
53
53
  import { META_SENDER_BACKENDS, resolveTrustedMetaSenderIdentity } from "../pi-extensions/lib/meta-sender-identity.ts";
54
54
  import { listAllMetaIdentitiesDir, processStartKey } from "../pi-extensions/lib/meta-session.ts";
55
+ import { reclaimOnExit } from "./lib/reclaim-on-exit.ts";
55
56
 
56
57
  const REPO = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
57
58
  const PLUGIN = "entwurf-meta-receive-copilot";
@@ -63,7 +64,8 @@ function ok(label: string, cond: boolean): void {
63
64
  passed++;
64
65
  }
65
66
 
66
- const root = mkdtempSync(path.join(tmpdir(), "entwurf-copilot-birth."));
67
+ const root = reclaimOnExit(mkdtempSync(path.join(tmpdir(), "entwurf-copilot-birth.")));
68
+
67
69
  const asm = path.join(root, "asm");
68
70
 
69
71
  // ── 1. the real assembler ────────────────────────────────────────────────────