@herbertgao/pi-extensions 2026.10.15 → 2026.10.16
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.
- package/README.md +6 -6
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.en.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/README.md +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/config.ts +38 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/config/panel.ts +13 -9
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/default-mode.ts +2 -2
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/diff-highlight.ts +41 -1
- package/node_modules/@herbertgao/pi-cc-extensions/extensions/renderer/tool/diff/write-execution.ts +42 -25
- package/node_modules/@herbertgao/pi-cc-extensions/package.json +4 -4
- package/node_modules/pi-lens/CHANGELOG.md +37 -0
- package/node_modules/pi-lens/README.md +32 -0
- package/node_modules/pi-lens/config/biome/core.jsonc +3 -3
- package/node_modules/pi-lens/dist/{chunk-K2GUZ4DN.js → chunk-2DDDCJDL.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-DS2USX5G.js → chunk-2DMLM3ZO.js} +11 -11
- package/node_modules/pi-lens/dist/chunk-2F47TQOA.js +73 -0
- package/node_modules/pi-lens/dist/{chunk-YXDCRUKQ.js → chunk-2PHMIAKO.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-PP2A5V2T.js → chunk-2RLWJO5K.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-T4NGVFYI.js → chunk-2X4VLOCC.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-QT66NEYN.js → chunk-3MYEA7QD.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-7ZS7MC24.js → chunk-3WEPUD2V.js} +22 -22
- package/node_modules/pi-lens/dist/{chunk-TL2TCJYL.js → chunk-4AVZ3TG7.js} +14 -14
- package/node_modules/pi-lens/dist/{chunk-SNEUMLM7.js → chunk-4PCQCU47.js} +4 -4
- package/node_modules/pi-lens/dist/chunk-4WX4CTUE.js +57 -0
- package/node_modules/pi-lens/dist/{chunk-5LRUKYFA.js → chunk-5APMQ2IJ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-4U7GDSZQ.js → chunk-5CV5ITZF.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-VUAVE3QC.js → chunk-5ZR3APIM.js} +36 -36
- package/node_modules/pi-lens/dist/{chunk-CPZ5JJW6.js → chunk-63RIVFQI.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-EDMLIW6W.js → chunk-75SY4F24.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-RCHO5W7M.js → chunk-7RQXA5GG.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-XHDBJODR.js → chunk-A3YNG5KP.js} +21 -21
- package/node_modules/pi-lens/dist/{chunk-3WCEHYOI.js → chunk-AE37FEGH.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-KPVLQHCZ.js → chunk-AMXIUN2R.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-XI34NWDI.js → chunk-ARD426WI.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-RG3MXTRI.js → chunk-BHUWL2Y3.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-4ODSZ35Z.js → chunk-BI5LAQ3Y.js} +44 -44
- package/node_modules/pi-lens/dist/{chunk-Q42LJANT.js → chunk-BM5GS6ZH.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-CG5V25HX.js → chunk-BWYQUPOS.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-HYVXA3BB.js → chunk-CFRQMBGP.js} +23 -23
- package/node_modules/pi-lens/dist/{chunk-NLIVE7L6.js → chunk-CJYKEW2L.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-MEFLGBCS.js → chunk-DC4CFXM5.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-ASRAO7KG.js → chunk-DMSLNKF7.js} +27 -27
- package/node_modules/pi-lens/dist/{chunk-YSDPVDFC.js → chunk-DQXSPYRI.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-YKVDBNPO.js → chunk-EVDGNG4F.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-2LDMXL2M.js → chunk-F5Z6URKM.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-72J27ICO.js → chunk-F6X3YJWD.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-YXGRRORB.js → chunk-FA5LDARD.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-OMJ3OFBJ.js → chunk-FFL3A2VP.js} +6 -6
- package/node_modules/pi-lens/dist/chunk-FJIVKLPH.js +31 -0
- package/node_modules/pi-lens/dist/chunk-G2B7F6ZU.js +88 -0
- package/node_modules/pi-lens/dist/{chunk-YWWG4AQA.js → chunk-GAACZY6R.js} +24 -25
- package/node_modules/pi-lens/dist/{chunk-F7BO6FWH.js → chunk-GMTFDAOK.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-UVY4TOJH.js → chunk-GNSIWBAT.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-GTAI2J6U.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-SJHC3BCZ.js → chunk-GZE7WOI4.js} +98 -111
- package/node_modules/pi-lens/dist/{chunk-ZAPSUBLU.js → chunk-H7HTEQUZ.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-ZPJM7DID.js → chunk-HK6JVFZC.js} +3 -3
- package/node_modules/pi-lens/dist/chunk-IPDG45G5.js +26 -0
- package/node_modules/pi-lens/dist/{chunk-ZSUX7KEM.js → chunk-J6JP25XU.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-6XSESGWD.js → chunk-JL6CXUMW.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-Y5KTA2OB.js → chunk-K2YGBXOA.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-AHWA4AKM.js → chunk-KLQVC3XC.js} +4 -4
- package/node_modules/pi-lens/dist/{chunk-27VWVB23.js → chunk-KSR7RGQY.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-N3PLNNCW.js → chunk-KXF5R4UN.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-GLW3YDZZ.js → chunk-LEJOJDXL.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-Y2TPADJR.js → chunk-MA77RSFN.js} +9 -9
- package/node_modules/pi-lens/dist/{chunk-IL7K66ZQ.js → chunk-MKVZQUEG.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-EIKRZ32J.js → chunk-MN7MHUXQ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-4FHUGDKU.js → chunk-MT6BVNFW.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-3SNDVPOR.js → chunk-NDMCVUYK.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-63NMUNYP.js → chunk-NIU2IPC5.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-APFJKOP6.js → chunk-NNKXDXXS.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-FEDWAYDS.js → chunk-OJLTLYHB.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-KJJAVH3X.js → chunk-OLAWH5UQ.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-G224FADB.js → chunk-OOU2WZZE.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-NFNVDDGB.js → chunk-OSTKYB55.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-P4QNXS6I.js +27 -0
- package/node_modules/pi-lens/dist/{chunk-7IYC4ENJ.js → chunk-PKES3ISE.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-UCVMSOXF.js → chunk-PO45POGF.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-JWOVP5BL.js → chunk-PPIBVH4R.js} +6 -6
- package/node_modules/pi-lens/dist/{chunk-EWXXLS26.js → chunk-PQJFG24Z.js} +82 -12
- package/node_modules/pi-lens/dist/{chunk-TPYYEDP5.js → chunk-Q3UZHW6N.js} +45 -22
- package/node_modules/pi-lens/dist/{chunk-5DKE4HGX.js → chunk-Q4EMRFNA.js} +34 -34
- package/node_modules/pi-lens/dist/{chunk-XHLK33VM.js → chunk-Q4FCYCRE.js} +16 -16
- package/node_modules/pi-lens/dist/chunk-Q6D6VMI4.js +22 -0
- package/node_modules/pi-lens/dist/{chunk-Q4BKKOVC.js → chunk-QGSTQH4D.js} +8 -8
- package/node_modules/pi-lens/dist/{chunk-GYRZ72R4.js → chunk-RZOXUSPC.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-EN5AM7PX.js → chunk-S67UJDGQ.js} +10 -10
- package/node_modules/pi-lens/dist/{chunk-YWNO5Q4R.js → chunk-SCIUNBPF.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-VIDEKABZ.js → chunk-SJJYRZB4.js} +2 -2
- package/node_modules/pi-lens/dist/chunk-SXGD4ANG.js +25 -0
- package/node_modules/pi-lens/dist/{chunk-THEXI2QO.js → chunk-T7FTXGS3.js} +42 -42
- package/node_modules/pi-lens/dist/{chunk-WUY4BZEP.js → chunk-TIQJPRDD.js} +106 -50
- package/node_modules/pi-lens/dist/{chunk-EXVXBSGN.js → chunk-TIYGSODX.js} +17 -17
- package/node_modules/pi-lens/dist/{chunk-2FYKETQJ.js → chunk-U2SDMG7C.js} +5 -5
- package/node_modules/pi-lens/dist/{chunk-PJXNTPB2.js → chunk-U6OC3QEM.js} +21 -21
- package/node_modules/pi-lens/dist/{chunk-LMCTHJ2H.js → chunk-UCGQT677.js} +18 -18
- package/node_modules/pi-lens/dist/{chunk-UL5SXQVX.js → chunk-UHGF5UT5.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-AI3GP74G.js → chunk-UN4TEBWN.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-2SDHYHHO.js → chunk-V3APN3DY.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-7FLRUH6B.js → chunk-V63BC55Q.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-S55TEC7I.js → chunk-VG5JS5SW.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-IEBJF3PN.js → chunk-VPBIMOAQ.js} +11 -11
- package/node_modules/pi-lens/dist/{chunk-EX4EXBW7.js → chunk-VQH24FIP.js} +15 -15
- package/node_modules/pi-lens/dist/{chunk-TVZRLTG6.js → chunk-VSFLRN5Y.js} +1 -1
- package/node_modules/pi-lens/dist/{chunk-KCBRHV5E.js → chunk-W2V54OCL.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-VITFDI3O.js → chunk-W5LGKNET.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-OZNCKLOX.js → chunk-W5R5SABV.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-ELZRSR5N.js → chunk-WIZWZR4C.js} +38 -38
- package/node_modules/pi-lens/dist/{chunk-MKPCELNI.js → chunk-WQOIR3QY.js} +13 -13
- package/node_modules/pi-lens/dist/{chunk-COOUUC5W.js → chunk-XAIT2YGS.js} +6 -6
- package/node_modules/pi-lens/dist/chunk-XCUHKYCQ.js +23 -0
- package/node_modules/pi-lens/dist/{chunk-KFXCL4OV.js → chunk-XQCSWV2G.js} +22 -23
- package/node_modules/pi-lens/dist/{chunk-RU34BA4D.js → chunk-YBSONGSZ.js} +34 -34
- package/node_modules/pi-lens/dist/{chunk-GTDSYEA2.js → chunk-YISME6ON.js} +1 -1
- package/node_modules/pi-lens/dist/chunk-YRD4ISED.js +30 -0
- package/node_modules/pi-lens/dist/{chunk-X3UTCXAA.js → chunk-YSBHPOY6.js} +12 -12
- package/node_modules/pi-lens/dist/{chunk-XWFIHYCH.js → chunk-Z2XAOKHK.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-K4SZB56V.js → chunk-Z7IGUAXL.js} +7 -7
- package/node_modules/pi-lens/dist/{chunk-KX56K73G.js → chunk-ZKXQKGWZ.js} +2 -2
- package/node_modules/pi-lens/dist/{chunk-FWZRGGGY.js → chunk-ZQ6NZZTB.js} +6 -4
- package/node_modules/pi-lens/dist/{chunk-2Y6OJRSI.js → chunk-ZUUI3ZSA.js} +3 -3
- package/node_modules/pi-lens/dist/{chunk-UO66IMVP.js → chunk-ZYNI26MI.js} +2 -2
- package/node_modules/pi-lens/dist/index.js +571 -409
- package/node_modules/pi-lens/dist/mcp/analyze-cli.js +10 -10
- package/node_modules/pi-lens/dist/mcp/cli.js +42 -42
- package/node_modules/pi-lens/dist/mcp/server.js +108 -108
- package/node_modules/pi-lens/dist/mcp/worker.js +61 -61
- package/node_modules/pi-lens/dist/probes/installer.js +19 -19
- package/node_modules/pi-lens/docs/agent-tools.md +28 -7
- package/node_modules/pi-lens/docs/configuration.md +3 -1
- package/node_modules/pi-lens/docs/defect-shapes.md +738 -0
- package/node_modules/pi-lens/docs/invariants/caches-stores.md +30 -0
- package/node_modules/pi-lens/docs/invariants/dispatch-runners.md +164 -0
- package/node_modules/pi-lens/docs/invariants/git-guard-host.md +53 -0
- package/node_modules/pi-lens/docs/invariants/language-config.md +31 -0
- package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +286 -0
- package/node_modules/pi-lens/docs/invariants/paths-os.md +59 -0
- package/node_modules/pi-lens/docs/invariants/session-telemetry.md +74 -0
- package/node_modules/pi-lens/docs/pi-lens-fixer.md +2 -1
- package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +10 -8
- package/node_modules/pi-lens/docs/pi-lens-monitor.md +2 -2
- package/node_modules/pi-lens/docs/pi-lens-orchestration.md +41 -0
- package/node_modules/pi-lens/docs/pi-lens-release.md +20 -0
- package/node_modules/pi-lens/docs/pi-lens-retro.md +3 -2
- package/node_modules/pi-lens/docs/pi-lens-reviewer.md +6 -6
- package/node_modules/pi-lens/docs/pi-lens-subagent.md +2 -2
- package/node_modules/pi-lens/package.json +3 -2
- package/node_modules/pi-provider-qoder/dist/index.js +27 -5
- package/node_modules/pi-provider-qoder/package.json +1 -1
- package/node_modules/pi-typesafe/README.md +1 -1
- package/node_modules/pi-typesafe/dist/client.js +43 -1
- package/node_modules/pi-typesafe/package.json +1 -1
- package/package.json +5 -5
- package/node_modules/pi-lens/dist/chunk-22Y2BM7H.js +0 -23
- package/node_modules/pi-lens/dist/chunk-44X7VIKR.js +0 -73
- package/node_modules/pi-lens/dist/chunk-54NIOJJZ.js +0 -25
- package/node_modules/pi-lens/dist/chunk-7WWQAW5P.js +0 -30
- package/node_modules/pi-lens/dist/chunk-EA2ZRG44.js +0 -27
- package/node_modules/pi-lens/dist/chunk-EKNWOL2I.js +0 -27
- package/node_modules/pi-lens/dist/chunk-G5UCJFT7.js +0 -26
- package/node_modules/pi-lens/dist/chunk-N5FBM25N.js +0 -22
- package/node_modules/pi-lens/dist/chunk-P5XUGPIX.js +0 -31
- package/node_modules/pi-lens/dist/chunk-PKOXJIVT.js +0 -88
- package/node_modules/pi-lens/dist/chunk-RG7OODGM.js +0 -57
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<important if="touching session, telemetry, and delivery rules">
|
|
2
|
+
|
|
3
|
+
### Session, telemetry, and delivery
|
|
4
|
+
|
|
5
|
+
- Registry root ownership (#3849): each holder's record in a pid entry's
|
|
6
|
+
`projectRootHolders` lists exactly the roots THAT holder registered (`host`
|
|
7
|
+
for `registerInstance`, a per-activation id for a declined secondary). Only
|
|
8
|
+
its own `deregisterInstanceRoot`, whole-entry removal, or cap eviction ends
|
|
9
|
+
a record; a root stays while any record lists it. No anonymous counts; one
|
|
10
|
+
settle (`settleRootHolders`) for every writer; `getInstanceRoots` reads.
|
|
11
|
+
- Session state is owned by the stable session identity and activation owner.
|
|
12
|
+
Detached callbacks resolve live emitters at delivery time and pair them with
|
|
13
|
+
their own activation context. Never use a process-global latest session.
|
|
14
|
+
- Process-global bridge dependencies and the quiet-window turn-summary holder
|
|
15
|
+
bind only from a live primary `SessionScope`; `clients/process-bridge.ts`
|
|
16
|
+
accepts only a strictly newer scope ticket, so a concurrent secondary or
|
|
17
|
+
stale activation cannot rebind a held bridge/task to its runtime (#4258).
|
|
18
|
+
- Session degradation uses the ledger's bounded once/count APIs and resets at
|
|
19
|
+
the correct primary session boundary. `SessionStartClassification`
|
|
20
|
+
(`clients/session-lifecycle.ts`): `primary` and `sequential-replacement`
|
|
21
|
+
(resume and reload) both run the full start and reset; only
|
|
22
|
+
`concurrent-secondary` skips the reset, since a subagent reset tears down the
|
|
23
|
+
primary's warm state. `secondary` belongs to the shutdown classification. A process-lifetime latch cannot store a
|
|
24
|
+
session fact without an explicit reset.
|
|
25
|
+
- Turn state is the turn's session's (#3613): `RuntimeCoordinator.beginTurn`
|
|
26
|
+
takes the ctx's stable session id and moves the coordinator's counters,
|
|
27
|
+
write-order turn and change window only for its own session, and per-turn
|
|
28
|
+
warnings are partitioned by the session that recorded them. Every
|
|
29
|
+
producer and reader passes that id (`tool_result`, a partial apply's
|
|
30
|
+
pipeline, `turn_end`). A concurrent secondary still shares the read guard
|
|
31
|
+
and the turn-end worklist (the open half of #3613). State `turn_end` parks
|
|
32
|
+
in a scope cell for a later turn lives on the activation's own scope
|
|
33
|
+
(`TurnEndDeps.sessionScope`, passed by `index.ts`), never on
|
|
34
|
+
`runtime.sessionScope`, which is the primary's during a secondary's turn
|
|
35
|
+
(#4154: the late dead-code scan). A turn-end drain or write-back is fenced
|
|
36
|
+
by the scope that owns the store, taken at entry (#4161, #4168 round 3):
|
|
37
|
+
the coordinator's for the coordinator and module stores a secondary
|
|
38
|
+
shares, the activation's for its own scope cell. One store never answers
|
|
39
|
+
to two scopes, and a secondary's end fences only its cell.
|
|
40
|
+
- Every session-scope hand-off decision leaves one `latency.log` row per
|
|
41
|
+
lifecycle event, never one per occurrence in a loop (#3873):
|
|
42
|
+
`session_handoff_slot`, `session_handoff_adopt`, `session_store_action`
|
|
43
|
+
(a store's `restore` returns its `StoreCarry`, items in and kept),
|
|
44
|
+
`session_scope_transition` (`end`, `demote`) and `session_end_fence_rollup`.
|
|
45
|
+
`docs/pi-lens-monitor.md` lists the fields; a new session store or hand-off
|
|
46
|
+
branch adds its row there in the same change.
|
|
47
|
+
- Logger writes use `createNdjsonLogger`; flush before reading a log. Redact at
|
|
48
|
+
the sink. New failure records preserve the discriminating file/tool/record
|
|
49
|
+
identity and retain dropped counts.
|
|
50
|
+
- `memory_sample` remains one bounded latency record. Its heap, external,
|
|
51
|
+
worker-isolate, tree-sitter, and word-index fields are latest-value or O(1)
|
|
52
|
+
reads; sampler assembly time is recorded in `samplerDurationMs`.
|
|
53
|
+
- Delivery surfaces are registered in `clients/finding-delivery-gate.ts`.
|
|
54
|
+
Every model-facing diagnostic, blocker, advisory, widget, nudge, and snapshot
|
|
55
|
+
either passes the shared freshness/disposition gate or carries an explicit
|
|
56
|
+
bounded age label.
|
|
57
|
+
- The dispatcher coverage notice (`buildCoverageNotice`) latches once per
|
|
58
|
+
session (`coverageNoticeSeen`) for the pi push surface; pull surfaces
|
|
59
|
+
(`pilens_analyze`, including its warm PostToolUse hook route) pass
|
|
60
|
+
`dedupeCoverageNotice: false` so every call carries the notice and the push
|
|
61
|
+
latch stays untouched (#3791). The warm hook deliberately repeats the notice
|
|
62
|
+
on every edit, matching its cold hook route. A primary off in
|
|
63
|
+
`lsp.disabledServers` gets one "disabled in config" note per server per
|
|
64
|
+
session instead of the per-file notice.
|
|
65
|
+
- `pilens:files:touched` publishers are `clients/pipeline.ts` and
|
|
66
|
+
`clients/runtime-agent-end.ts`; `clients/agent-nudge.ts` is the subscriber.
|
|
67
|
+
`clients/lsp-mutation.ts` has an optional callback but is not a publisher until
|
|
68
|
+
it is wired. Update `tests/config/files-touched-bus-conformance.test.ts` for
|
|
69
|
+
any publisher or subscriber change.
|
|
70
|
+
- Deferred work has a bounded queue, wall budget, abort path, carry-forward
|
|
71
|
+
identity, and honest partial/deferred delivery. It never publishes a false
|
|
72
|
+
clean result after cutting work.
|
|
73
|
+
|
|
74
|
+
</important>
|
|
@@ -293,7 +293,8 @@ rigor (#2599).
|
|
|
293
293
|
(#4439).
|
|
294
294
|
- A `Shape: new: <name>` is a proposal, not a catalog entry: write the
|
|
295
295
|
proposed shape text in the PR body under "Proposed contract change
|
|
296
|
-
(maintainer decision)" and never edit `
|
|
296
|
+
(maintainer decision)" and never edit `docs/defect-shapes.md`. Catalog shapes
|
|
297
|
+
and rule
|
|
297
298
|
changes are the maintainer's decision; the orchestrator lands an approved
|
|
298
299
|
one in its own change (#4577's fixer added shape 74 unasked, and the
|
|
299
300
|
governance suites redded).
|
|
@@ -237,7 +237,7 @@ reviewer. File only different-seam, blocked, decision-dependent, untouched
|
|
|
237
237
|
pre-existing, or risk-class-changing items, as one consolidated issue per PR.
|
|
238
238
|
|
|
239
239
|
Folds also decide the issue list itself, one step earlier than a review
|
|
240
|
-
finding: `
|
|
240
|
+
finding: `docs/pi-lens-orchestration.md` states that check.
|
|
241
241
|
|
|
242
242
|
A brief carries the lane's facts and the task, and points at the role
|
|
243
243
|
contract for everything else. Lane facts are the worktree, branch, base,
|
|
@@ -261,15 +261,15 @@ These are the habits the train depends on. They live here, not in any one
|
|
|
261
261
|
operator's private notes, so a different orchestrator can run the same train.
|
|
262
262
|
|
|
263
263
|
- **Contracts move in the same session.** When a review or a dogfood finding
|
|
264
|
-
reveals a defect CLASS (not an instance), add a numbered shape to
|
|
265
|
-
catalog with the issue ref and a one-line screen, extend the fixer's screen
|
|
264
|
+
reveals a defect CLASS (not an instance), add a numbered shape to the defect-shape
|
|
265
|
+
catalog (`docs/defect-shapes.md`) with the issue ref and a one-line screen, extend the fixer's screen
|
|
266
266
|
list, and cite the number in the next brief — before the next dispatch. "To
|
|
267
267
|
err twice is not the mark of a wise man." (2026-09-03: shapes 28–36 came out
|
|
268
268
|
of one day's reviews this way.)
|
|
269
269
|
- **Second instance of a catalogued shape opens the consolidation lane, not a
|
|
270
270
|
third instance fix (2026-09-09).** The trigger is the shape recurring at all,
|
|
271
271
|
not only twice in one session: when a review, an issue or a dogfood finding
|
|
272
|
-
is the second member of a shape already in
|
|
272
|
+
is the second member of a shape already in the defect-shape catalog, the
|
|
273
273
|
orchestrator files the consolidation lane BEFORE the second instance merges,
|
|
274
274
|
with three fixed deliverables: one seam every consumer calls, one log line
|
|
275
275
|
per resolution (which value was chosen and why, throttled once per key per
|
|
@@ -435,7 +435,8 @@ operator's private notes, so a different orchestrator can run the same train.
|
|
|
435
435
|
`final-review`; NOT borrowed from it: auto-fixing null checks, error
|
|
436
436
|
handling or cleanup hooks, which change meaning.
|
|
437
437
|
- **Allocate the catalog number at MERGE, not at dispatch (2026-09-15).**
|
|
438
|
-
|
|
438
|
+
The defect-shape catalog (`docs/defect-shapes.md`) is a markdownlint MD029
|
|
439
|
+
ordered list: the
|
|
439
440
|
number is the list position, so dispatch-time reservations create a gap on
|
|
440
441
|
branches whose holder has not merged. The orchestrator owns allocation; a
|
|
441
442
|
lane may draft a shape but must not claim a number. At merge, insert or
|
|
@@ -562,7 +563,8 @@ operator's private notes, so a different orchestrator can run the same train.
|
|
|
562
563
|
If that layer does not exist, file it as an issue with the bug as
|
|
563
564
|
its named recurrence — the same standard shapes are held to. The lesson
|
|
564
565
|
names the defect SHAPE and its tree-wide enforcer, not only a test for the
|
|
565
|
-
instance: the Gap names the `
|
|
566
|
+
instance: the Gap names the `docs/defect-shapes.md` catalog shape (or a new
|
|
567
|
+
shape) and
|
|
566
568
|
either a test that scans the whole population, an issue to build one, or
|
|
567
569
|
`judgment-only` with the reason. A one-bug test is the fix's regression
|
|
568
570
|
test, not the closed gap (lint half: #4439). The ledger
|
|
@@ -821,7 +823,7 @@ Each row cost a lane at least once; the prose above carries the record.
|
|
|
821
823
|
| Routing on the word "governance" instead of the risk | #4350 (a CodeQL pin-equality test) went to Opus as "governance authoring"; the Opus rule is for source-scanning detectors only. |
|
|
822
824
|
| Leaving the `dist/` precondition undeclared | At least 5 lanes (#4417, #4418, the #4422 verify, the #4410 r1 review, the #4423 review F5) each ruled out the same 3 census reds that need `npm run build:dist` (2026-10-14). Mechanical: fail fast when a selected test needs `dist/` and it is missing or stale (#4436); `CLAUDE.md` names `npm run build:dist` for those files meanwhile |
|
|
823
825
|
| A wait helper with a fixed wall-clock budget | `interleaving-kit` `waitFor` ran out at 3000 ms under CI load (run 38618401454, `tests/clients/fix-run-restore.test.ts:378`); the file passed alone and under 3 shuffle seeds, so the red read as a flake. Mechanical, filed as #4437 |
|
|
824
|
-
| Briefing a worker to "report the size first" before a large migration | A worker cannot wait for a reply, so the #4432 fixer did the migration anyway (2026-10-14). A brief authorizes the conditional branch with its bound, or tells the worker to stop and hand back; `
|
|
826
|
+
| Briefing a worker to "report the size first" before a large migration | A worker cannot wait for a reply, so the #4432 fixer did the migration anyway (2026-10-14). A brief authorizes the conditional branch with its bound, or tells the worker to stop and hand back; `docs/pi-lens-orchestration.md` |
|
|
825
827
|
| Naming a file by basename in a brief | "index.ts" meant `clients/lsp/index.ts`; a Haiku measurement pass searched the root `index.ts` and reported the #2052 comment missing (2026-10-14). Name every file by its repo path |
|
|
826
828
|
| Sending a lane that must find its own failure space to Haiku | #4342 rounds 1 and 2 left three review findings (a wall-clock bound, a wrong offline premise, a 13-vs-20 population); a fresh Opus round with a state table passed verify first time (#4410 round 3). Haiku folds with a prescribed remedy (#4340, #4341, #4345, #4356, #4368, #4372, #4374, #4417) landed first try. Haiku takes only a prescribed change; `AGENTS.md` "Orchestration and delegated work" |
|
|
827
829
|
| Listing a blast radius without the changed result's callers | #4411 round 3 changed `touchFile`'s result and the body omitted the cascade neighbour caller (`clients/dispatch/integration.ts:2139`), which then printed an uncaused "inconclusive" line every turn (review N2). `AGENTS.md` already requires `module_report` with `blastRadius: true` before and after; run it for the changed result and quote every caller, then read each one |
|
|
@@ -830,7 +832,7 @@ Each row cost a lane at least once; the prose above carries the record.
|
|
|
830
832
|
| Concluding "no existing seam does this" from a search of your own call names | #4528 searched `notifyExternalFileChange\(` and missed six freshness modules in `clients/`; five detectors ended up wiring their own consumers (#4535). Search by primitive (`docs/pi-lens-fixer.md` "Before code"); the reviewer widens the query (`docs/pi-lens-reviewer.md`, #4536) |
|
|
831
833
|
| Importing `dist/` from a script a workflow runs before any build | #4525's `scripts/assert-evaluated.mjs` reached `dist/` through `lib/clean-signal.mjs`, so `tool-smoke-prs` would fail on every refresh PR. #4531 pins the import graph with a test and plants |
|
|
832
834
|
| Pinning workflow step shell as text instead of running it | #4531 r1: four mutations of the Swift, APFS and handshake shell survived, including deleting `set +e`. Run the extracted step shell against stubs in a test |
|
|
833
|
-
| Filing gap after gap on one mechanism without an audit | Eleven freshness gaps went into #4532 before anyone asked why there were eleven; the cause was one missing fan-out (#4535). Three issues on one mechanism open a consolidation audit (`
|
|
835
|
+
| Filing gap after gap on one mechanism without an audit | Eleven freshness gaps went into #4532 before anyone asked why there were eleven; the cause was one missing fan-out (#4535). Three issues on one mechanism open a consolidation audit (`docs/pi-lens-orchestration.md`) |
|
|
834
836
|
| Landing with an unresolved bot review thread | #4548 and #4558 merged with open Greptile threads (2026-10-17); each one's disposition arrived or never did, and nothing held the land. Every bot thread gets a disposition reply and is resolved before the merge (step 1 and step 4 of "The loop, per PR") |
|
|
835
837
|
| Pushing a worker tree on a stale "failed" settlement | The #4575 r5 settlement read as failed while its resumed turn was live and about to push (plegma #752). The orchestrator's push-verify now refuses a tree with a live agent process, and its wait loop takes a `turnId`. |
|
|
836
838
|
| Settling a fix round with unpushed commits | #4582 r1 settled with the commits still local and nobody noticed (plegma #753). The settlement hook now prints `UNPUSHED` or `DIRTY` for the tree it just settled. |
|
|
@@ -5,8 +5,8 @@ maintainer does not have to. The monitor observes; it never edits code,
|
|
|
5
5
|
never restarts anything, and never touches the session it is reading.
|
|
6
6
|
|
|
7
7
|
Read first: the engineering principles (`docs/engineering-principles.md`),
|
|
8
|
-
then `AGENTS.md`
|
|
9
|
-
a fixed bound reached at p50 is a design defect), then
|
|
8
|
+
then `AGENTS.md` and the defect-shape catalog (`docs/defect-shapes.md`,
|
|
9
|
+
especially shape 41: a fixed bound reached at p50 is a design defect), then
|
|
10
10
|
`docs/pi-lens-subagent.md` and `docs/pi-lens-investigator.md` for the
|
|
11
11
|
forensics conventions this role inherits. This contract adds the standing
|
|
12
12
|
readout.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Orchestration procedure
|
|
2
|
+
|
|
3
|
+
The orchestrator-only half of `AGENTS.md` "Orchestration and delegated work":
|
|
4
|
+
brief authoring, review intake, the fold check, and the merge gate's CI read.
|
|
5
|
+
The delegation and hand-back rules a worker obeys stay in `AGENTS.md`; the
|
|
6
|
+
per-PR loop itself is `docs/pi-lens-merge-policy.md`.
|
|
7
|
+
|
|
8
|
+
- A brief never asks a worker to wait for an answer ("report the size first"):
|
|
9
|
+
a worker cannot wait for a reply. It either authorizes the conditional
|
|
10
|
+
branch with its bound, or tells the worker to stop and hand back there.
|
|
11
|
+
- A brief names every file by its repo path (`clients/lsp/index.ts`, never
|
|
12
|
+
`index.ts`): a bare basename resolves to another file in a read-only pass.
|
|
13
|
+
- After every completion, push, verdict, merge, or status request, trigger the
|
|
14
|
+
next named owner in the same pass, and keep the handoff (exact head, verdict,
|
|
15
|
+
dispositions, next owner) on the PR or the ledger.
|
|
16
|
+
- Review intake generalizes before it routes. For every HIGH, MEDIUM or
|
|
17
|
+
CRITICAL finding, name the defect shape, grep the tree for other members, and
|
|
18
|
+
record a verdict before the fix round dispatches: contained in this PR (with
|
|
19
|
+
the sweep), sibling issue filed with the member list, or none (with the
|
|
20
|
+
grep). The fix brief carries it as a `Shape:` line. History: `HISTORY.md`,
|
|
21
|
+
2026-10-10.
|
|
22
|
+
- Plegma reads are token-budgeted (#417): settlements via `watch --next --mine`,
|
|
23
|
+
`result` only when the transcript or handoff artifact is needed.
|
|
24
|
+
- Every regroup, merged bug fix, second round on one shape, and incident runs
|
|
25
|
+
the retrospective in `docs/pi-lens-retro.md`.
|
|
26
|
+
- Three open issues on one mechanism, in any seam groups, open a consolidation
|
|
27
|
+
audit across every consumer of that mechanism before the next one is filed
|
|
28
|
+
(history: `HISTORY.md`, 2026-10-16).
|
|
29
|
+
- Run the **fold check** as soon as a lane's mechanism is known, which is when
|
|
30
|
+
the brief is written: read every open issue against that mechanism and decide
|
|
31
|
+
each candidate as folded into this PR (one `Closes #…` per folded issue) or
|
|
32
|
+
not folded, with the reason (two hazards in one review, a maintainer decision,
|
|
33
|
+
a blocked dependency, a different seam). The brief carries the candidate list
|
|
34
|
+
and its decisions, and the PR body records them under `## Fold check`.
|
|
35
|
+
Planning precedes filing: a new issue is the answer for p2+ work no lane can
|
|
36
|
+
carry, never for a p3 the lane could fold (history: `HISTORY.md`, 2026-10-20).
|
|
37
|
+
- The per-PR loop (review, verify, auto-merge on green), round routing, the
|
|
38
|
+
merge gate and the Common mistakes table live in `docs/pi-lens-merge-policy.md`.
|
|
39
|
+
- Read CI with `node scripts/ci-verdict.mjs <pr|sha>` (exact head, all pages).
|
|
40
|
+
Never merge on absent, stale, or advisory-only checks.
|
|
41
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<important if="building, packaging, or releasing">
|
|
2
|
+
|
|
3
|
+
## Build, packaging, and release
|
|
4
|
+
|
|
5
|
+
`main` and `pi.extensions` point to `dist/index.js`; `dist/` is generated and
|
|
6
|
+
not committed. `prepare` builds it for git and package installs. `build:dist`
|
|
7
|
+
bundles pure-JS dependencies while keeping host-provided and lazy native
|
|
8
|
+
packages external. Package-root resource resolution is depth-robust; pi
|
|
9
|
+
resolves `pi.skills` entries relative to the package root, so manifests use
|
|
10
|
+
`"./skills"` and never an escaping path.
|
|
11
|
+
|
|
12
|
+
Runtime imports must be production dependencies. The pi SDK is an optional
|
|
13
|
+
peer/dev dependency and must be imported type-only. Lockfiles use the pinned
|
|
14
|
+
npm version. Release notes use one `.changelog/<slug>.md` fragment per PR
|
|
15
|
+
(`audience: user` or `internal`; the release body lists only `user`); never
|
|
16
|
+
edit `CHANGELOG.md` for ordinary PR notes.
|
|
17
|
+
New user-facing fragments begin with a bold lead of at most 100 characters
|
|
18
|
+
(issue references are excluded from the count); internal fragments are exempt.
|
|
19
|
+
|
|
20
|
+
</important>
|
|
@@ -8,7 +8,8 @@ output of this role. Source of truth for every rule here is this file and
|
|
|
8
8
|
|
|
9
9
|
Read first: the engineering principles (`docs/engineering-principles.md`),
|
|
10
10
|
then `AGENTS.md` ("Recurring defect shapes", "Orchestration and delegated
|
|
11
|
-
work", "Test requirements"),
|
|
11
|
+
work", "Test requirements"), the shape entries it indexes
|
|
12
|
+
(`docs/defect-shapes.md`), then `docs/pi-lens-subagent.md` when delegated,
|
|
12
13
|
then this contract and `docs/pi-lens-merge-policy.md` ("Common mistakes"),
|
|
13
14
|
which is where mistake rows land.
|
|
14
15
|
|
|
@@ -61,7 +62,7 @@ job logs on the exact head, `latency.log` under the resolved log root (`docs/pi-
|
|
|
61
62
|
exactly as a regression test would; a check without a red is a proposal and
|
|
62
63
|
is filed as an issue naming the incident as its recurrence, not merged.
|
|
63
64
|
4. **Judgement candidates become one line in the right place.** A defect shape
|
|
64
|
-
goes into the `
|
|
65
|
+
goes into the catalog (`docs/defect-shapes.md`) as a lean screen, and its issues, PRs and
|
|
65
66
|
examples go to `HISTORY.md`, under a heading that names the shape, such as
|
|
66
67
|
`## 2026-10-14 - title (shape N)`: a lean entry cites no issue, and
|
|
67
68
|
`tests/config/shape-history-governance.test.ts` finds the record by that
|
|
@@ -63,24 +63,24 @@ does not ship.
|
|
|
63
63
|
| A new `it(` or `test(` title, or a case added to a table test | Red first: the case fails on the pre-fix source, with the failure the defect names (principles §2 "Red first") | The pre-fix transcript, with its `Tests N failed` line naming the new titles | #4577 (Greptile, 2026-10-17: round-4 cases shipped with no red) |
|
|
64
64
|
| A new guard, branch, filter, cap or fallback | Mutation red on that predicate, both directions, in a compile-valid change (principles §2 "Mutation output is quoted") | The `scripts/mutate.mjs` transcript and its `RED` status line, with the one test it reds | #4575 (Greptile r4304045025: no mutation red for the saveOnly rule) |
|
|
65
65
|
| A file under `clients/lsp/`, `formal/`, or any path `formal/switch-pins.json` names | The model moves with the code: a `.tla`/`.cfg` hunk and its TLC verdict, or a `TLA+ unaffected:` line; a flipped constant flips its config and its pin (AGENTS shape 68) | The line, or the model diff plus the verdict, and the pin's test name for a flipped constant | #4575 (Greptile r4304045020: the model did not move with the code), #4387, #4393 |
|
|
66
|
-
| A spawn, shell or path seam: `clients/package-manager.ts`, `clients/lsp/launch.ts`, `clients/path-utils.ts`, `clients/safe-spawn.ts`, or any `trySpawn` caller | Read the Windows lane, and keep a shim cell that asserts the platform command (AGENTS "Test requirements"; "Dispatch, runners, formatters, and installers") | The `Unit tests Windows` row on the head, or the shim cell's platform assertion | #4566 (Greptile r4304149666: the `.cmd` cells), #4356, #4263 |
|
|
67
|
-
| A rung that can execute project code | Judge the rung by the resolved target under every trust state, never by the name it was called with (
|
|
66
|
+
| A spawn, shell or path seam: `clients/package-manager.ts`, `clients/lsp/launch.ts`, `clients/path-utils.ts`, `clients/safe-spawn.ts`, or any `trySpawn` caller | Read the Windows lane, and keep a shim cell that asserts the platform command (AGENTS "Test requirements"; `docs/invariants/dispatch-runners.md` "Dispatch, runners, formatters, and installers") | The `Unit tests Windows` row on the head, or the shim cell's platform assertion | #4566 (Greptile r4304149666: the `.cmd` cells), #4356, #4263 |
|
|
67
|
+
| A rung that can execute project code | Judge the rung by the resolved target under every trust state, never by the name it was called with (`docs/invariants/lsp-trust-exec.md` "LSP, trust, and process execution") | The target table: each spelling, its resolved path, and the verdict under trusted, unknown and denied | #4566 (an empty `PATH` and a global link each ran project code), #4530 |
|
|
68
68
|
| A new shared helper | Net-count rule: delete a same-shape sibling in this change (principles §1 "Net-count rule for shared helpers") | The deleted sibling in `Change outline`, or the unsafe-to-fold reason with its follow-up link | #2585 r1, #2617 r1 (an existing override and scan set bypassed or recopied), #3064, #3065, #3066, #3068 (a fold's newly sole predicate left untested) |
|
|
69
69
|
| A second writer, reader or mirror of one shared record | Design shared state once, with a reason or kind discriminator per writer (principles §1 "Design shared state once"; AGENTS shape 24) | The writers-by-axis table, and the discriminator each writer carries | #1631/#1641 (the `stale` collision that was green alone), #1633, #1703 |
|
|
70
70
|
| A durable record whose shape changes, or a new version of one | Keep the fixture corpus: every version that produced the record still parses (principles §2 "Keep fixture corpora") | The fixture path and the parser test that replays it | #3594 R2-F1 (AGENTS shape 57) |
|
|
71
71
|
| A cache or memo key | Key every input the value depends on, trust scope and install state included (AGENTS shape 6) | The key's input list beside the value's dependencies, and the mutation that changes one input | #4562 (a large update left a cached answer), #4566 (a trust change left tools missing) |
|
|
72
72
|
| A test-side source scan, census, ratchet or detector | Detectors match code, not prose, and fail closed on an unlisted spelling (principles §2 "Detectors match code"; AGENTS shape 69) | The blanked-source read, and three plants the author did not design for: an alias, an indirect call, a value through another binding | #2693 (a ratchet counted four sites where six existed), #4439 |
|
|
73
73
|
| A workflow, action or job | The edited lane runs on a pull request, or a branch run is quoted with its run id (AGENTS "Commands and gates") | `gh workflow run <file> --ref <branch>` with its run id, or the PR-eligible cell's name | #3043, #3085 |
|
|
74
|
-
| A `continue-on-error` producer or a nightly floor | The producer reports to `scripts/assert-evaluated.mjs`, and its floor reds below the measured count (
|
|
74
|
+
| A `continue-on-error` producer or a nightly floor | The producer reports to `scripts/assert-evaluated.mjs`, and its floor reds below the measured count (`docs/invariants/lsp-trust-exec.md` "LSP, trust, and process execution") | The floor value beside the run's evaluated count | #4518 |
|
|
75
75
|
| A path a host tool was given (a `~`, an `@` prefix, a `file://` URL), or a path re-resolved after it left disk | Resolve by provenance, one seam per provenance; a generated or recovered path is never re-resolved (AGENTS shape 74) | The resolver the caller uses, and the path form it accepts, before and after | #4576, #4577 (a bash operand resolved on the host-argument ladder, then an absolute spelling rewritten) |
|
|
76
76
|
| A path recovered from disk, a synthetic write event, or a path pi-lens generates | The path carries its provenance, host argument, shell token, recovered or generated, and nothing re-derives it (AGENTS shape 58) | The provenance the caller states at the injection point, and the resolver it therefore skips | #4577 (a recovered name was re-folded), #4558 |
|
|
77
77
|
| A path-keyed map, normalizer or path comparison | Normalize on write, read, delete and rehydrate, and test Windows separators and casing (AGENTS shape 1) | The writer and reader table, with the normalizer each one calls | #3178 (four rounds, two inverted arms, one unmeasured swap) |
|
|
78
|
-
| A session, lifecycle, generation or turn-end seam | Capture the generation before the await, and key the state by the session that owns it (AGENTS shapes 21 and 22; "Session, telemetry, and delivery") | The captured scope or generation the write checks, and the test that races it | #4258 (a stale activation rebinding a held bridge), #4154 |
|
|
78
|
+
| A session, lifecycle, generation or turn-end seam | Capture the generation before the await, and key the state by the session that owns it (AGENTS shapes 21 and 22; `docs/invariants/session-telemetry.md` "Session, telemetry, and delivery") | The captured scope or generation the write checks, and the test that races it | #4258 (a stale activation rebinding a held bridge), #4154 |
|
|
79
79
|
| A lifecycle, ownership or queue-ordering change | Name a cell and a mutation per axis: owner and identity, last leave, and queue ordering (principles §1 "Identity and lifecycle rules"; AGENTS shapes 21 and 22) | The state table with one row per axis, and the mutation transcript for each cell | #4563 (seven lifecycle findings), #4575 (a slow send overwrote a newer edit), #4562 |
|
|
80
|
-
| A lifecycle change | The TLA+ model moves with the code, and `docs/pi-lens-monitor.md` gains the row for a new store or hand-off branch (AGENTS shape 68; "Session, telemetry, and delivery") | The model diff or `TLA+ unaffected:` line, and the monitor-doc row | #4563, #4569 (held documents undercounted), #4575 |
|
|
80
|
+
| A lifecycle change | The TLA+ model moves with the code, and `docs/pi-lens-monitor.md` gains the row for a new store or hand-off branch (AGENTS shape 68; `docs/invariants/session-telemetry.md` "Session, telemetry, and delivery") | The model diff or `TLA+ unaffected:` line, and the monitor-doc row | #4563, #4569 (held documents undercounted), #4575 |
|
|
81
81
|
| A delivery surface, or a bound on findings that reach the model | A bound discloses its truncation on the rendered surface, and a skipped or unavailable result is not clean (AGENTS shape 10) | The rendered truncation line, or the skip reason from `RUNNER_SKIP_REASONS` | #3166 r2 (an 80-finding input bound zeroed a neighbour's errors) |
|
|
82
82
|
| A relaxed or rewritten existing assertion | Mutate the behaviour the test is named for; a rewrite that stays green is a deleted test (AGENTS "Issue and PR design contract"; principles §2) | The red on the new assertion, with that behaviour broken | #4390 (the eviction smoke's rewrite passed with root re-registration broken) |
|
|
83
|
-
| A new decision branch on a session, lifecycle or delivery seam | Name its record, sink plus kind, and read it back through the real seam (
|
|
83
|
+
| A new decision branch on a session, lifecycle or delivery seam | Name its record, sink plus kind, and read it back through the real seam (`docs/invariants/session-telemetry.md` "Session, telemetry, and delivery"; shape 31) | The record literal, and the test that reads it back | #3873 (a fix that could not be shown to fire live), #3875 |
|
|
84
84
|
| A new failure path, catch or silent return | One bounded record per distinct event, in a stream a monitor reads without asking (principles §1 "Every new failure path gets bounded observability"; shape 31) | The record literal and its sink, or `none:` with its reason | #4562 (a failed log write stayed silent), #4575 (a failed save left no trace) |
|
|
85
85
|
| Every diff, every changed file, tests included | Read the whole diff file by file. Check each PR-body claim against the diff, and look in the body for proof before calling it missing (principles §3 "Reviewing and delegating") | The body line or transcript quoted beside a claim the diff cannot show, or the finding names the body line that lacks it | #4574 F2, #4582 F1; 3 of Greptile's 4 false positives were a transcript already in the body (#4572, #4573, #4577) |
|
|
86
86
|
|
|
@@ -221,8 +221,8 @@ foreground, push with the targeted and governance suites green and say that
|
|
|
221
221
|
the full suite was delegated to CI.
|
|
222
222
|
|
|
223
223
|
Pin `PI_LENS_HOME` and `PILENS_DATA_DIR` to `<worktree>/.probe-home` for
|
|
224
|
-
probes, smoke scripts, and `npm install`/`npm ci` (`
|
|
225
|
-
and operating systems"); a test that inspects the install record also pins
|
|
224
|
+
probes, smoke scripts, and `npm install`/`npm ci` (`docs/invariants/paths-os.md`
|
|
225
|
+
"Paths, data, and operating systems"); a test that inspects the install record also pins
|
|
226
226
|
`PI_LENS_INSTALL_LOG`. Never export them for a Vitest run: the setup keeps
|
|
227
227
|
the real home on purpose (#3178). Kill every language server a probe spawns
|
|
228
228
|
before moving on; the plegma daemon's cgroup holds every worker's children
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-lens",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Real-time code feedback for pi — LSP, linters, formatters, type-checking, structural analysis & booboo",
|
|
6
6
|
"repository": {
|
|
@@ -171,6 +171,7 @@
|
|
|
171
171
|
"protobufjs@7.6.6": true
|
|
172
172
|
},
|
|
173
173
|
"overrides": {
|
|
174
|
-
"qs": "^6.15.4"
|
|
174
|
+
"qs": "^6.15.4",
|
|
175
|
+
"undici": "^8.12.2"
|
|
175
176
|
}
|
|
176
177
|
}
|
|
@@ -9881,10 +9881,26 @@ function parseModelBusyRejection(body) {
|
|
|
9881
9881
|
if (busy?.code !== MODEL_BUSY_CODE) return void 0;
|
|
9882
9882
|
const queue = parseJsonObject(busy.message);
|
|
9883
9883
|
if (!queue) return void 0;
|
|
9884
|
-
if (queue.
|
|
9885
|
-
const seconds =
|
|
9886
|
-
|
|
9887
|
-
|
|
9884
|
+
if (queue.serviceAvailable !== true) return void 0;
|
|
9885
|
+
const seconds = (value) => typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.round(value * 1e3) : 0;
|
|
9886
|
+
if (queue.isQueued === false) {
|
|
9887
|
+
return { kind: "ready", retryAfterMs: seconds(queue.retryAfterSeconds) };
|
|
9888
|
+
}
|
|
9889
|
+
if (queue.isQueued === true) {
|
|
9890
|
+
const waitMs = seconds(queue.waitTime) || seconds(queue.retryAfterSeconds);
|
|
9891
|
+
const queueCount = typeof queue.queueCount === "number" ? queue.queueCount : void 0;
|
|
9892
|
+
const queueType = typeof queue.queueType === "string" ? queue.queueType : void 0;
|
|
9893
|
+
return { kind: "queued", waitMs, queueCount, queueType };
|
|
9894
|
+
}
|
|
9895
|
+
return void 0;
|
|
9896
|
+
}
|
|
9897
|
+
function formatQueuedBusyError(snapshot) {
|
|
9898
|
+
const waitSeconds = Math.round(snapshot.waitMs / 1e3);
|
|
9899
|
+
const ahead = snapshot.queueCount !== void 0 ? `, ${snapshot.queueCount} ahead` : "";
|
|
9900
|
+
const tier = snapshot.queueType ? ` (${snapshot.queueType})` : "";
|
|
9901
|
+
return new Error(
|
|
9902
|
+
`Qoder model is busy: request queued (10605 CALL_COUNT_LIMIT${tier}${ahead}, ~${waitSeconds}s wait, rate limit, retry-after-ms=${snapshot.waitMs})`
|
|
9903
|
+
);
|
|
9888
9904
|
}
|
|
9889
9905
|
function sleepWithAbort(ms, signal) {
|
|
9890
9906
|
if (signal?.aborted) return Promise.reject(new Error("Aborted"));
|
|
@@ -10287,13 +10303,19 @@ function streamQoder(model, context, options) {
|
|
|
10287
10303
|
const envelope = JSON.parse(dataStr);
|
|
10288
10304
|
if (envelope.statusCodeValue && envelope.statusCodeValue !== 200) {
|
|
10289
10305
|
const busy = parseModelBusyRejection(envelope.body);
|
|
10290
|
-
if (busy) {
|
|
10306
|
+
if (busy?.kind === "ready") {
|
|
10291
10307
|
throw new QoderModelBusyError(
|
|
10292
10308
|
`Upstream status ${envelope.statusCodeValue}: ${envelope.body}`,
|
|
10293
10309
|
busy.retryAfterMs,
|
|
10294
10310
|
sawModelOutput
|
|
10295
10311
|
);
|
|
10296
10312
|
}
|
|
10313
|
+
if (busy?.kind === "queued") {
|
|
10314
|
+
if (sawModelOutput) {
|
|
10315
|
+
throw new Error("Qoder model rejected the request after partial output (10605 RESOURCE_LIMIT)");
|
|
10316
|
+
}
|
|
10317
|
+
throw formatQueuedBusyError(busy);
|
|
10318
|
+
}
|
|
10297
10319
|
throw new Error(`Upstream status ${envelope.statusCodeValue}: ${envelope.body}`);
|
|
10298
10320
|
}
|
|
10299
10321
|
const innerStr = envelope.body;
|
|
@@ -24,7 +24,7 @@ Then, inside Pi:
|
|
|
24
24
|
2. `/typesafe test` sends one built-in sample request and shows the answers.
|
|
25
25
|
3. `/typesafe enable` lets the agent call the tool for this session, after you confirm the data notice.
|
|
26
26
|
|
|
27
|
-
Requires Pi 0.85 or newer and Node.js 22.19 or newer. Usage is billed to your TypeSafe account. For CI or scripts set `TYPESAFE_API_KEY` in the environment instead; it takes precedence over the stored key. Do not paste the key into chat, command arguments, or project files.
|
|
27
|
+
Requires Pi 0.85 or newer and Node.js 22.19 or newer. It runs under Bun as well, where Pi ships: there the judge transport replays each response body, because Bun 1.4.4 marks a body used once a reader on it is released. Usage is billed to your TypeSafe account. For CI or scripts set `TYPESAFE_API_KEY` in the environment instead; it takes precedence over the stored key. Do not paste the key into chat, command arguments, or project files.
|
|
28
28
|
|
|
29
29
|
## The three question types
|
|
30
30
|
|
|
@@ -55,6 +55,46 @@ async function translateModels(response, backend) {
|
|
|
55
55
|
});
|
|
56
56
|
return send(JSON.stringify({ models }));
|
|
57
57
|
}
|
|
58
|
+
/** Runtime detection rather than a config flag: the transport below differs only because Bun reads a body differently. */
|
|
59
|
+
const BUN_VERSION = process.versions.bun;
|
|
60
|
+
/**
|
|
61
|
+
* A response with no body, answering `text()` and `json()` from bytes already read. Bun 1.4.4 throws `TypeError: Body
|
|
62
|
+
* already used` from the SDK's own `res.text()`: the SDK's buffering step takes a reader on `response.body` and releases
|
|
63
|
+
* it, which Bun counts as using the body (measured 28 Oct 2026 on Bun 1.4.4; Node 26 read the body after that step, and
|
|
64
|
+
* the Node 22.19, 24, and 26 jobs run the same assertion in CI).
|
|
65
|
+
* A plain `Response` built from a string is stamped by Bun on a reader exactly the same way, so the replay carries no
|
|
66
|
+
* body for that step to touch. The SDK reads only `status`, `ok`, `headers` and `text()` from a response.
|
|
67
|
+
*/
|
|
68
|
+
class ReplayedResponse extends Response {
|
|
69
|
+
#body;
|
|
70
|
+
constructor(body, init) {
|
|
71
|
+
super(null, init);
|
|
72
|
+
this.#body = body;
|
|
73
|
+
}
|
|
74
|
+
text() {
|
|
75
|
+
return Promise.resolve(this.#body);
|
|
76
|
+
}
|
|
77
|
+
json() {
|
|
78
|
+
return Promise.resolve(JSON.parse(this.#body));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Read the body here and hand the SDK a response that has none, keeping it readable past the SDK's buffering step.
|
|
83
|
+
* Wraps whatever transport is in play — the default, a path rewrite, or the caller's own — because Bun stamps a response
|
|
84
|
+
* `translateModels` builds on a reader exactly as it stamps a network one, and two wrappers stacked stay harmless.
|
|
85
|
+
*/
|
|
86
|
+
function readableTransport(inner) {
|
|
87
|
+
return async (input, init) => {
|
|
88
|
+
const response = await inner(input, init);
|
|
89
|
+
// Read under the caller's signal, so an abort still rejects with its reason instead of a half-read body.
|
|
90
|
+
const body = await response.text();
|
|
91
|
+
const headers = new Headers(response.headers);
|
|
92
|
+
// The body is replayed, so a copied length or encoding would describe bytes that are no longer on the wire.
|
|
93
|
+
headers.delete("content-length");
|
|
94
|
+
headers.delete("content-encoding");
|
|
95
|
+
return new ReplayedResponse(body, { status: response.status, statusText: response.statusText, headers });
|
|
96
|
+
};
|
|
97
|
+
}
|
|
58
98
|
/** Default attempts per client instance; the extension quotes the same number in its consent copy. */
|
|
59
99
|
export const DEFAULT_MAX_REQUESTS = 20;
|
|
60
100
|
function positiveInteger(value, label) {
|
|
@@ -159,7 +199,9 @@ export function createTypeSafe(options = {}) {
|
|
|
159
199
|
...(options.maxUsdPerDay === undefined ? {} : { maxUsdPerDay: positiveNumber(options.maxUsdPerDay, "maxUsdPerDay") }),
|
|
160
200
|
}, capsFromEnvironment());
|
|
161
201
|
// A backend with its own paths or model list fields gets a transport that rewrites them; the default backend keeps the caller's.
|
|
162
|
-
const
|
|
202
|
+
const routed = backend.path !== undefined || backend.modelsPath !== undefined || backend.modelsField !== undefined ? backendFetch(backend, options.fetch) : options.fetch;
|
|
203
|
+
// One wrapper ahead of both, so the backend's paths and the caller's own transport are covered; on Node the transport stays as it was.
|
|
204
|
+
const transport = BUN_VERSION === undefined ? routed : readableTransport(routed ?? fetch);
|
|
163
205
|
// The caller's input is validated as written, then mapped to the backend's id form; omitting it sends the backend's
|
|
164
206
|
// own default, which the mapping leaves unchanged.
|
|
165
207
|
const requested = options.model ?? backend.defaultModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-typesafe",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "TypeSafe AI (Jev) decisions for Pi: batched Choice/Score/Noul evaluation tool, terminal playground, and a typed API other extensions build on.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbertgao/pi-extensions",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.16",
|
|
4
4
|
"description": "Aggregate installer for HerbertGao-maintained Pi extensions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"extensions",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@dietrichgebert/ponytail": "5.3.2",
|
|
41
41
|
"@herbertgao/pi-agency": "0.1.2",
|
|
42
42
|
"@herbertgao/pi-bark": "0.2.1",
|
|
43
|
-
"@herbertgao/pi-cc-extensions": "1.0.
|
|
43
|
+
"@herbertgao/pi-cc-extensions": "1.0.12-local.1",
|
|
44
44
|
"@herbertgao/pi-subagents": "0.22.0-local.2",
|
|
45
45
|
"@herbertgao/sol-pi": "0.4.2",
|
|
46
46
|
"@juicesharp/rpiv-ask-user-question": "2.15.0",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"nanoid": "^5.0.0",
|
|
73
73
|
"p-limit": "^6.1.0",
|
|
74
74
|
"pi-antigravity": "0.11.0",
|
|
75
|
-
"pi-lens": "4.4.
|
|
75
|
+
"pi-lens": "4.4.6",
|
|
76
76
|
"pi-next-cue": "1.0.8",
|
|
77
|
-
"pi-provider-qoder": "0.6.
|
|
78
|
-
"pi-typesafe": "0.13.
|
|
77
|
+
"pi-provider-qoder": "0.6.6",
|
|
78
|
+
"pi-typesafe": "0.13.1",
|
|
79
79
|
"pi-web-access": "0.45.0",
|
|
80
80
|
"pidusage": "^4.0.1",
|
|
81
81
|
"promise.try": "^2.0.1",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
computeImpactCascade,
|
|
4
|
-
computeTransitiveImpact
|
|
5
|
-
} from "./chunk-YSDPVDFC.js";
|
|
6
|
-
import "./chunk-CPZ5JJW6.js";
|
|
7
|
-
import "./chunk-KX56K73G.js";
|
|
8
|
-
import "./chunk-TPYYEDP5.js";
|
|
9
|
-
import "./chunk-KJJAVH3X.js";
|
|
10
|
-
import "./chunk-ZSUX7KEM.js";
|
|
11
|
-
import "./chunk-EIKRZ32J.js";
|
|
12
|
-
import "./chunk-FWZRGGGY.js";
|
|
13
|
-
import "./chunk-N3PLNNCW.js";
|
|
14
|
-
import "./chunk-S26LC76R.js";
|
|
15
|
-
import "./chunk-XWFIHYCH.js";
|
|
16
|
-
import "./chunk-TVZRLTG6.js";
|
|
17
|
-
import "./chunk-LJDODBBZ.js";
|
|
18
|
-
import "./chunk-EWXXLS26.js";
|
|
19
|
-
import "./chunk-NXL4FFQQ.js";
|
|
20
|
-
export {
|
|
21
|
-
computeImpactCascade,
|
|
22
|
-
computeTransitiveImpact
|
|
23
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
adaptLspService,
|
|
4
|
-
getLSPService,
|
|
5
|
-
groupFilesByPrimaryServer,
|
|
6
|
-
hasAuxiliaryLspPublishedForRoot,
|
|
7
|
-
notifyExternalFileChange,
|
|
8
|
-
peekLSPService,
|
|
9
|
-
resetLSPService,
|
|
10
|
-
resyncGitChangedFiles,
|
|
11
|
-
runPerServerGroups
|
|
12
|
-
} from "./chunk-SJHC3BCZ.js";
|
|
13
|
-
import "./chunk-MEFLGBCS.js";
|
|
14
|
-
import "./chunk-XIMYZ3JA.js";
|
|
15
|
-
import "./chunk-7ZS7MC24.js";
|
|
16
|
-
import "./chunk-6XSESGWD.js";
|
|
17
|
-
import "./chunk-3SNDVPOR.js";
|
|
18
|
-
import "./chunk-JWOVP5BL.js";
|
|
19
|
-
import "./chunk-2LDMXL2M.js";
|
|
20
|
-
import "./chunk-FEDWAYDS.js";
|
|
21
|
-
import "./chunk-CPZ5JJW6.js";
|
|
22
|
-
import "./chunk-7IYC4ENJ.js";
|
|
23
|
-
import "./chunk-KX56K73G.js";
|
|
24
|
-
import "./chunk-YWWG4AQA.js";
|
|
25
|
-
import "./chunk-Z54ZSOBZ.js";
|
|
26
|
-
import "./chunk-2Y6OJRSI.js";
|
|
27
|
-
import "./chunk-WUY4BZEP.js";
|
|
28
|
-
import "./chunk-GTDSYEA2.js";
|
|
29
|
-
import "./chunk-6HWVI6MI.js";
|
|
30
|
-
import "./chunk-UL5SXQVX.js";
|
|
31
|
-
import "./chunk-CKEQFGLT.js";
|
|
32
|
-
import "./chunk-NLIVE7L6.js";
|
|
33
|
-
import "./chunk-IEBJF3PN.js";
|
|
34
|
-
import "./chunk-UO66IMVP.js";
|
|
35
|
-
import "./chunk-Q42LJANT.js";
|
|
36
|
-
import "./chunk-APFJKOP6.js";
|
|
37
|
-
import "./chunk-2BEMIWEW.js";
|
|
38
|
-
import "./chunk-IJYGIDF4.js";
|
|
39
|
-
import "./chunk-IL7K66ZQ.js";
|
|
40
|
-
import "./chunk-4FHUGDKU.js";
|
|
41
|
-
import "./chunk-K4SZB56V.js";
|
|
42
|
-
import "./chunk-XI34NWDI.js";
|
|
43
|
-
import "./chunk-5LRUKYFA.js";
|
|
44
|
-
import "./chunk-63NMUNYP.js";
|
|
45
|
-
import "./chunk-CG5V25HX.js";
|
|
46
|
-
import "./chunk-PP2A5V2T.js";
|
|
47
|
-
import "./chunk-S55TEC7I.js";
|
|
48
|
-
import "./chunk-TPYYEDP5.js";
|
|
49
|
-
import "./chunk-AWQWXSW4.js";
|
|
50
|
-
import "./chunk-QYF5S6P6.js";
|
|
51
|
-
import "./chunk-GYRZ72R4.js";
|
|
52
|
-
import "./chunk-KJJAVH3X.js";
|
|
53
|
-
import "./chunk-ZSUX7KEM.js";
|
|
54
|
-
import "./chunk-EIKRZ32J.js";
|
|
55
|
-
import "./chunk-FWZRGGGY.js";
|
|
56
|
-
import "./chunk-N3PLNNCW.js";
|
|
57
|
-
import "./chunk-S26LC76R.js";
|
|
58
|
-
import "./chunk-XWFIHYCH.js";
|
|
59
|
-
import "./chunk-TVZRLTG6.js";
|
|
60
|
-
import "./chunk-LJDODBBZ.js";
|
|
61
|
-
import "./chunk-EWXXLS26.js";
|
|
62
|
-
import "./chunk-NXL4FFQQ.js";
|
|
63
|
-
export {
|
|
64
|
-
adaptLspService,
|
|
65
|
-
getLSPService,
|
|
66
|
-
groupFilesByPrimaryServer,
|
|
67
|
-
hasAuxiliaryLspPublishedForRoot,
|
|
68
|
-
notifyExternalFileChange,
|
|
69
|
-
peekLSPService,
|
|
70
|
-
resetLSPService,
|
|
71
|
-
resyncGitChangedFiles,
|
|
72
|
-
runPerServerGroups
|
|
73
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createRequire as __pilensCreateRequire } from "node:module"; const require = __pilensCreateRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
getSourceFiles,
|
|
4
|
-
getSourceFilesAsync
|
|
5
|
-
} from "./chunk-CG5V25HX.js";
|
|
6
|
-
import "./chunk-PP2A5V2T.js";
|
|
7
|
-
import "./chunk-S55TEC7I.js";
|
|
8
|
-
import "./chunk-TPYYEDP5.js";
|
|
9
|
-
import "./chunk-QYF5S6P6.js";
|
|
10
|
-
import "./chunk-GYRZ72R4.js";
|
|
11
|
-
import "./chunk-KJJAVH3X.js";
|
|
12
|
-
import "./chunk-ZSUX7KEM.js";
|
|
13
|
-
import "./chunk-EIKRZ32J.js";
|
|
14
|
-
import "./chunk-FWZRGGGY.js";
|
|
15
|
-
import "./chunk-N3PLNNCW.js";
|
|
16
|
-
import "./chunk-S26LC76R.js";
|
|
17
|
-
import "./chunk-XWFIHYCH.js";
|
|
18
|
-
import "./chunk-TVZRLTG6.js";
|
|
19
|
-
import "./chunk-LJDODBBZ.js";
|
|
20
|
-
import "./chunk-EWXXLS26.js";
|
|
21
|
-
import "./chunk-NXL4FFQQ.js";
|
|
22
|
-
export {
|
|
23
|
-
getSourceFiles,
|
|
24
|
-
getSourceFilesAsync
|
|
25
|
-
};
|