pi-ui-extend 1.0.39 → 1.0.41

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 (113) hide show
  1. package/README.md +1 -1
  2. package/dist/app/commands/command-registry.js +2 -2
  3. package/dist/app/commands/command-session-actions.d.ts +0 -1
  4. package/dist/app/commands/command-session-actions.js +22 -13
  5. package/dist/app/icons.d.ts +14 -0
  6. package/dist/app/icons.js +33 -0
  7. package/dist/app/rendering/conversation-tool-renderer.js +2 -2
  8. package/dist/app/rendering/dcp-stats.d.ts +6 -1
  9. package/dist/app/rendering/dcp-stats.js +214 -46
  10. package/dist/app/rendering/editor-panels.js +8 -5
  11. package/dist/app/session/lazy-session-manager.js +12 -1
  12. package/dist/app/session/tabs-controller.d.ts +2 -5
  13. package/dist/app/session/tabs-controller.js +12 -21
  14. package/dist/app/subagents/subagents-model.d.ts +14 -1
  15. package/dist/app/subagents/subagents-model.js +34 -15
  16. package/dist/app/types.d.ts +2 -0
  17. package/dist/bundled-extensions/session-title/config.js +1 -1
  18. package/dist/markdown-format.js +27 -9
  19. package/dist/schemas/pi-tools-suite-schema.d.ts +29 -16
  20. package/dist/schemas/pi-tools-suite-schema.js +46 -31
  21. package/external/pi-tools-suite/README.md +392 -52
  22. package/external/pi-tools-suite/docs/browser-qa-subagent.md +31 -21
  23. package/external/pi-tools-suite/docs/context-gateway-p00-adr.md +216 -0
  24. package/external/pi-tools-suite/docs/context-gateway-p01n-gate-review.md +122 -0
  25. package/external/pi-tools-suite/docs/context-gateway-p01n-measurement.md +133 -0
  26. package/external/pi-tools-suite/docs/context-gateway-p01r-ra-evidence.md +111 -0
  27. package/external/pi-tools-suite/docs/context-gateway-p01r-rb-evidence.md +100 -0
  28. package/external/pi-tools-suite/docs/context-gateway-p01r-rc-evidence.md +69 -0
  29. package/external/pi-tools-suite/docs/context-gateway-p01r-rd-evidence.md +100 -0
  30. package/external/pi-tools-suite/docs/context-gateway-p01r-re-evidence.md +74 -0
  31. package/external/pi-tools-suite/docs/context-gateway-p01r-rf-evidence.md +153 -0
  32. package/external/pi-tools-suite/docs/context-gateway-p01r-rg-evidence.md +235 -0
  33. package/external/pi-tools-suite/docs/evals.md +684 -0
  34. package/external/pi-tools-suite/docs/subagent-model-pools.md +109 -0
  35. package/external/pi-tools-suite/package.json +10 -3
  36. package/external/pi-tools-suite/src/async-subagents/{private-skills → agents}/browser-qa/scripts/browser-qa-runner.mjs +82 -1
  37. package/external/pi-tools-suite/src/async-subagents/{private-skills/browser-qa/SKILL.md → agents/browser-qa.md} +261 -12
  38. package/external/pi-tools-suite/src/async-subagents/agents/implement.md +20 -0
  39. package/external/pi-tools-suite/src/async-subagents/agents/oracle.md +16 -0
  40. package/external/pi-tools-suite/src/async-subagents/agents/research.md +18 -0
  41. package/external/pi-tools-suite/src/async-subagents/agents/verify.md +18 -0
  42. package/external/pi-tools-suite/src/async-subagents/async-subagents.sample.jsonc +27 -243
  43. package/external/pi-tools-suite/src/async-subagents/commands.ts +6 -2
  44. package/external/pi-tools-suite/src/async-subagents/core/agent-catalog.ts +41 -0
  45. package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +13 -93
  46. package/external/pi-tools-suite/src/async-subagents/core/agents-dir.ts +494 -0
  47. package/external/pi-tools-suite/src/async-subagents/core/browser-qa.ts +9 -0
  48. package/external/pi-tools-suite/src/async-subagents/core/config.ts +200 -143
  49. package/external/pi-tools-suite/src/async-subagents/core/model-fallback.ts +1 -1
  50. package/external/pi-tools-suite/src/async-subagents/core/model-selection.ts +54 -0
  51. package/external/pi-tools-suite/src/async-subagents/core/prompt.ts +7 -6
  52. package/external/pi-tools-suite/src/async-subagents/core/routing.ts +52 -45
  53. package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +12 -4
  54. package/external/pi-tools-suite/src/async-subagents/index.ts +11 -1
  55. package/external/pi-tools-suite/src/async-subagents/lib.ts +6 -2
  56. package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +46 -18
  57. package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +3 -2
  58. package/external/pi-tools-suite/src/async-subagents/types.ts +2 -0
  59. package/external/pi-tools-suite/src/coding-discipline/index.ts +41 -142
  60. package/external/pi-tools-suite/src/config.ts +1 -22
  61. package/external/pi-tools-suite/src/context-gateway/accounting.ts +151 -0
  62. package/external/pi-tools-suite/src/context-gateway/config.ts +111 -0
  63. package/external/pi-tools-suite/src/context-gateway/index.ts +160 -0
  64. package/external/pi-tools-suite/src/context-gateway/metadata-normalization.ts +88 -0
  65. package/external/pi-tools-suite/src/context-gateway/storeless-capabilities.ts +89 -0
  66. package/external/pi-tools-suite/src/context-gateway/telemetry.ts +429 -0
  67. package/external/pi-tools-suite/src/context-gateway/test-output-parser.ts +326 -0
  68. package/external/pi-tools-suite/src/context-gateway/types.ts +152 -0
  69. package/external/pi-tools-suite/src/dcp/auto-compress-budget.ts +106 -0
  70. package/external/pi-tools-suite/src/dcp/auto-compress.ts +810 -106
  71. package/external/pi-tools-suite/src/dcp/commands.ts +64 -139
  72. package/external/pi-tools-suite/src/dcp/compress-tool.ts +369 -35
  73. package/external/pi-tools-suite/src/dcp/compression-blocks.ts +510 -64
  74. package/external/pi-tools-suite/src/dcp/compression-preview.ts +113 -0
  75. package/external/pi-tools-suite/src/dcp/compression-progress.ts +70 -0
  76. package/external/pi-tools-suite/src/dcp/config.ts +36 -61
  77. package/external/pi-tools-suite/src/dcp/conversation-index.ts +421 -0
  78. package/external/pi-tools-suite/src/dcp/debug-log.ts +7 -5
  79. package/external/pi-tools-suite/src/dcp/index.ts +617 -203
  80. package/external/pi-tools-suite/src/dcp/journal.ts +566 -0
  81. package/external/pi-tools-suite/src/dcp/progress-controller.ts +244 -0
  82. package/external/pi-tools-suite/src/dcp/prompts.ts +10 -7
  83. package/external/pi-tools-suite/src/dcp/provider-tool-results.ts +189 -0
  84. package/external/pi-tools-suite/src/dcp/pruner-candidates.ts +298 -78
  85. package/external/pi-tools-suite/src/dcp/pruner-compression-blocks.ts +173 -281
  86. package/external/pi-tools-suite/src/dcp/pruner-emergency.ts +2 -4
  87. package/external/pi-tools-suite/src/dcp/pruner-message-ids.ts +17 -5
  88. package/external/pi-tools-suite/src/dcp/pruner-metadata.ts +11 -1
  89. package/external/pi-tools-suite/src/dcp/pruner-nudge.ts +30 -82
  90. package/external/pi-tools-suite/src/dcp/pruner-tools.ts +22 -133
  91. package/external/pi-tools-suite/src/dcp/pruner.ts +18 -33
  92. package/external/pi-tools-suite/src/dcp/recovery.ts +129 -0
  93. package/external/pi-tools-suite/src/dcp/shadow-plan.ts +127 -0
  94. package/external/pi-tools-suite/src/dcp/state-transaction.ts +102 -0
  95. package/external/pi-tools-suite/src/dcp/state.ts +158 -580
  96. package/external/pi-tools-suite/src/dcp/ui.ts +1 -0
  97. package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +55 -220
  98. package/external/pi-tools-suite/src/index.ts +9 -0
  99. package/external/pi-tools-suite/src/model-tools/index.ts +76 -42
  100. package/external/pi-tools-suite/src/repo-discovery/index.ts +84 -18
  101. package/external/pi-tools-suite/src/repo-discovery/native-compact.ts +458 -0
  102. package/external/pi-tools-suite/src/session-recovery/index.ts +189 -43
  103. package/external/pi-tools-suite/src/tool-descriptions.ts +43 -38
  104. package/external/pi-tools-suite/src/truncation-metadata-normalizer/index.ts +17 -0
  105. package/package.json +6 -6
  106. package/schemas/pi-tools-suite.json +159 -78
  107. package/external/pi-tools-suite/src/async-subagents/private-skills/browser-qa/references/auth-scaffold-spec.md +0 -78
  108. package/external/pi-tools-suite/src/async-subagents/private-skills/browser-qa/references/qa-design.md +0 -223
  109. package/external/pi-tools-suite/src/dcp/state-persistence.ts +0 -195
  110. /package/external/pi-tools-suite/src/async-subagents/{private-skills/browser-qa/references → agents/browser-qa/examples}/qa-auth.example.jsonc +0 -0
  111. /package/external/pi-tools-suite/src/async-subagents/{private-skills/browser-qa/references → agents/browser-qa/examples}/qa-flow.example.jsonc +0 -0
  112. /package/external/pi-tools-suite/src/async-subagents/{private-skills → agents}/browser-qa/vendor/fflate.LICENSE +0 -0
  113. /package/external/pi-tools-suite/src/async-subagents/{private-skills → agents}/browser-qa/vendor/fflate.mjs +0 -0
@@ -0,0 +1,235 @@
1
+ # Context Gateway P01-R / R-G storeless release evidence
2
+
3
+ <!-- markdownlint-disable MD013 -->
4
+
5
+ > Scope frozen before the R-G measurement gate on 7 September 2026.
6
+ > Repository HEAD: `daa1b06`; tested source tree is dirty and earlier live run identities must not be inferred from HEAD alone.
7
+ > This document does not authorise Context Gateway enforce mode or P02 durable storage.
8
+
9
+ ## Scope fixed before measurement
10
+
11
+ The candidate storeless release is deliberately small:
12
+
13
+ | Surface | Decision for R-G | Runtime effect |
14
+ | --- | --- | --- |
15
+ | Context Gateway observe | Keep available, `off` by default | Aggregate measurement/classification only; no result replacement or archive. |
16
+ | `repo_*` Native Compact | Accept as explicit opt-in profile | Existing bounded native flags/cursors/validation; no store. |
17
+ | `truncation-metadata-normalizer` | Accept as separate explicit opt-in module | Removes only proven duplicate truncation metadata for measured Read/shell/ast_grep shapes. |
18
+ | test/build parser | Keep observe-only | Safe classification/metrics only; no result replacement. |
19
+ | mutation/LSP | Native passthrough | Existing outcome/diagnostics behavior only. |
20
+ | web/document | Native passthrough / limited | No second fetch, no archive. |
21
+ | structured JSON | Native passthrough / limited | No generic parse/rewrite. |
22
+ | subagent result | Native passthrough / producer-managed lifetime | No parent grant or lifetime extension. |
23
+ | images | Native passthrough | No text replacement. |
24
+ | direct browser / MCP | Unsupported | Not in the claimed denominator. |
25
+
26
+ Provider-specific equality claims are limited to the installed OpenAI-completions
27
+ serialization path already exercised by the deterministic harness. UI claims are
28
+ limited to the current TUI result renderers and the existing ACP/Desktop lazy
29
+ persisted-result flow. Native temp-output contents do not get a new UI/ACP reader.
30
+
31
+ ## Metrics and release criteria fixed before measurement
32
+
33
+ R-G evaluates the following dimensions independently:
34
+
35
+ - task/fact correctness and execution outcome;
36
+ - initial delivered result bytes and all continuation/recovery calls;
37
+ - JSONL/details bytes for metadata-only cleanup;
38
+ - actual checked provider payload equality/usage rather than converting metadata
39
+ bytes into token estimates;
40
+ - tool-call/refusal/retry counts and elapsed time for model-driven evidence that
41
+ already exists;
42
+ - parser/capability CPU work through explicit scan/output bounds rather than a
43
+ claim based on one timing sample;
44
+ - native temp/current-file/index lifetime limitations and unavailable recovery;
45
+ - unsupported paths and failures remain in the report rather than being removed
46
+ from the denominator.
47
+
48
+ There is no aggregate batch-budget claim. P00 proved stable per-call identity and
49
+ source-order delivery, but not a host API that supplies a durable whole-batch
50
+ budget before execution. Batch cost is therefore the sum of actual per-result
51
+ traffic/calls in measurements.
52
+
53
+ ## Measurement results
54
+
55
+ The measurements below were run after the scope and criteria above were written.
56
+
57
+ ### Native Compact deterministic paired corpus
58
+
59
+ `PI_CONTEXT_GATEWAY_BENCHMARK_REPORT=1 bun test test/context-gateway/benchmark.test.ts`
60
+ compares the historical baseline behavior with the current Native Compact profile
61
+ over search, structure, AST, explain and dependency scenarios. All eight critical
62
+ facts are recovered in both arms.
63
+
64
+ | Metric | Baseline | Native Compact | Delta |
65
+ | --- | ---: | ---: | ---: |
66
+ | Delivered repo bytes including continuations | 71,025 | 27,519 | **-61.25%** |
67
+ | Tool calls | 6 | 8 | +2 |
68
+ | Continuation calls | 1 | 3 | +2 |
69
+ | Refusals | 0 | 0 | 0 |
70
+ | Full overrides | 0 | 0 | 0 |
71
+ | Critical facts | 8/8 | 8/8 | equal |
72
+
73
+ This is the expected trade-off for narrow native paging: substantially fewer
74
+ delivered bytes, but potentially more calls. It is not evidence of lower total
75
+ model cost by itself.
76
+
77
+ ### Historical model-driven paired evidence
78
+
79
+ The retained `zai/glm-5.3` paired report
80
+ `test/evals/artifacts/p01n-2026-09-07T17-30-21-479Z/p01n-paired-report.json`
81
+ contains three Prompt Compact / Native Compact pairs; all **6 arm-runs passed**.
82
+ It predates R-A v2 source/corpus identity, so R-G uses it only as historical
83
+ model-behavior/cost evidence rather than pretending it certifies the current dirty
84
+ tree byte-for-byte.
85
+
86
+ | Aggregate metric | Prompt Compact | Native Compact | Delta |
87
+ | --- | ---: | ---: | ---: |
88
+ | Repo-result bytes | 1,286 | 983 | **-23.6%** |
89
+ | All tool-result bytes | 9,737 | 9,149 | **-6.0%** |
90
+ | Tool calls | 14 | 12 | **-14.3%** |
91
+ | Parent tokens | 179,855 | 207,611 | **+15.4%** |
92
+ | Parent cost | $0.0682 | $0.0923 | **+35.4%** |
93
+ | Elapsed | 88.682s | 96.219s | **+8.5%** |
94
+ | Native refusals / full overrides / refusal retries | 0 / 0 / 0 | 0 / 0 / 0 | equal |
95
+
96
+ The live evidence therefore argues **against** making Native Compact the default:
97
+ repo traffic improved, but total token/cost/latency did not consistently improve.
98
+ It remains a useful explicit opt-in for workloads where repo-result volume is the
99
+ binding constraint.
100
+
101
+ ### Metadata normalizer
102
+
103
+ The normalizer changes only `details.truncation.content` on proven Read/shell/
104
+ `ast_grep` SDK shapes. A deterministic 24,007-byte duplicate fixture measured:
105
+
106
+ | Metric | Raw | Normalized | Delta |
107
+ | --- | ---: | ---: | ---: |
108
+ | Serialized tool-result JSON | 48,396 B | 24,376 B | **-24,020 B (-49.6%)** |
109
+ | Ten identical persisted results | — | — | **240,200 B avoided** |
110
+
111
+ The actual SDK fixtures in R-B also remove more than 40 KiB of duplicated metadata
112
+ from large Read/Bash results while preserving visible content and structural
113
+ truncation fields.
114
+
115
+ This is deliberately reported as JSONL/metadata savings only. The installed
116
+ OpenAI-completions serialization contract is byte-equivalent before/after cleanup
117
+ because tool-result `details` are not serialized to that provider payload. R-G
118
+ therefore claims **no token, cache or model-quality saving** from the normalizer.
119
+
120
+ An additional 52,000-byte duplicate sample, matching the approximate size of the
121
+ live observe residual details, measured `104,408 → 52,395 B` for the serialized
122
+ tool-result object and `52,279 → 266 B` for `details`: **52,013 B** removed while
123
+ visible content remained `52,035 B`. Seven reference-machine rounds of 10,000
124
+ normalizer calls on that sample measured approximately `3.5–4.3 µs/call`. These
125
+ timings are diagnostics, not a portable release threshold.
126
+
127
+ ### Residual and negative corpus
128
+
129
+ The live observe-only residual run shows the measured large classes remain real:
130
+ Read/Bash/ast_grep each delivered roughly 52 KiB of result content and roughly
131
+ another 52 KiB of details at the checked boundary. The Bash task assertion failed
132
+ because the model made an extra call; the large Bash observation itself remained
133
+ valid. That failure stays visible rather than being removed from the denominator.
134
+
135
+ R-A–R-F deterministic contracts cover the rest of the offline release corpus:
136
+
137
+ - small/exact/control results and current-file Read continuation;
138
+ - Unicode/CRLF/long-line and changed file/index behavior;
139
+ - successful Bash/ast_grep native recovery plus missing/replaced temp output;
140
+ - timeout/abort/nonzero and unavailable structured recovery handles;
141
+ - parser middle failures, PASS→exit-1 conflict, ANSI/CR, mixed/compound commands,
142
+ unknown formats and a bounded 1 Mi-character parser scan;
143
+ - mutation/LSP outcomes, web errors/cancellation, opaque large-integer JSON,
144
+ subagent producer-managed artifacts, image passthrough and unsupported browser/MCP;
145
+ - late/reloaded/session-switched results, parallel calls and UI/history replay.
146
+
147
+ The test/build parser is bounded but remains observe-only. Its prospective compact
148
+ candidate is all-or-passthrough and must fit the configured result budget; no
149
+ runtime result delivery, provider traffic, calls or token usage are changed by it.
150
+ On a 4,550,063-character synthetic input the 1 Mi-character scan bound produced
151
+ `scan-limited / partial`; seven rounds of 100 parses measured about
152
+ `16.2–16.9 ms/call` on the reference machine. This is CPU/telemetry evidence only,
153
+ not a shaping or provider-saving claim.
154
+
155
+ ## Live-run decision
156
+
157
+ R-G does **not** request another live model run for the selected release scope:
158
+
159
+ - the metadata normalizer is provider-invisible on the checked serializer and has
160
+ deterministic JSONL/provider equality contracts;
161
+ - the test/build parser does not replace results;
162
+ - mutation/LSP, web/JSON/subagent/image surfaces remain native passthrough;
163
+ - Native Compact already has retained paired model-driven evidence, while all
164
+ post-run changes relevant to this scope are deterministic policy/validation
165
+ hardening rather than a new model-visible adapter.
166
+
167
+ The R-A v2 recovery runner remains available for a future claim that specifically
168
+ depends on exact model-driven native-handle recovery. Such a run still requires
169
+ separate authorization and must create a new v2-identity report. R-G does not
170
+ reinterpret the old v1 recovery reports as v2 passes.
171
+
172
+ ## Release decision
173
+
174
+ Accept the verified storeless scope with conservative defaults:
175
+
176
+ 1. **Context Gateway stays `off` by default.** Observe remains an explicit passive
177
+ measurement mode; `enforce` remains unavailable.
178
+ 2. **Native Compact is accepted only as explicit opt-in.** Default
179
+ `repoDiscovery.profile` remains `baseline` because live total-cost evidence is
180
+ mixed despite lower repo-result traffic.
181
+ 3. **`truncation-metadata-normalizer` is accepted as a separate explicit opt-in.**
182
+ It remains disabled by default and claims JSONL/metadata reduction, not token
183
+ savings.
184
+ 4. **Test/build parsing stays observe-only.** No production compact-result adapter
185
+ is enabled without a proven recovery/lifetime contract for omitted data.
186
+ 5. **Mutation/LSP, web/document, JSON, subagent and visual paths remain their R-E
187
+ passthrough/limited decisions.** Browser/MCP direct adapters remain unsupported.
188
+ 6. **P02 durable store remains deferred.** R-G found no task requiring new durable
189
+ snapshot identity strongly enough to justify store/readers/quotas now.
190
+
191
+ Rollback is configuration-only for future calls: disable the normalizer module,
192
+ return `repoDiscovery.profile` to `baseline`, and/or set Context Gateway mode to
193
+ `off`. Rollback does not delete session history, native temp files, user data or
194
+ DCP state and does not require a manual sync operation.
195
+
196
+ ## Deterministic R-G gate
197
+
198
+ The final gate reuses the independently proven R-A–R-F contracts rather than one
199
+ monolithic test process where unrelated LSP/AgentSession suites can interfere with
200
+ shared process/temp state. The required groups are:
201
+
202
+ - Context Gateway/storeless contracts, Native Compact, recovery validator/corpus,
203
+ eval harness and coverage registry;
204
+ - ACP lazy history/replay and typecheck;
205
+ - root tab ownership/session UI contracts;
206
+ - suite/root `git diff --check` and source typechecks.
207
+
208
+ No new live model call, manual suite sync, durable store, reader tool or DCP change
209
+ is part of the R-G release gate.
210
+
211
+ The final external-suite P01-R gate is:
212
+
213
+ ```text
214
+ bun test \
215
+ test/context-gateway \
216
+ test/repo-native-compact.test.ts \
217
+ test/repo-discovery.test.ts \
218
+ test/config.test.ts \
219
+ test/evals/extension-contracts.test.ts \
220
+ test/evals/harness.test.ts \
221
+ test/evals/recovery-corpus.test.ts \
222
+ test/evals/recovery-run-identity.test.ts \
223
+ test/evals/recovery-report.test.ts \
224
+ test/evals/recovery-validation.test.ts
225
+ ```
226
+
227
+ Result: **144 pass, 0 fail, 1011 assertions**; suite typecheck and
228
+ `git diff --check` pass. Root SDK pin remains `0.85.1`; generated schemas are
229
+ unchanged when checked through `node --import tsx` (the sandbox blocks the normal
230
+ `tsx` CLI IPC socket), and root `tsc --noEmit` passes.
231
+
232
+ R-F's separate host/UI gates remain green: root TUI/session **98/98**, ACP lazy
233
+ current-result **4/4** plus an additional **6/6** persisted-history/request-boundary
234
+ suite and typecheck, and Desktop transcript/client **28/28** with Desktop check at
235
+ zero errors (two pre-existing accessibility warnings).