@zihanw/pi-forge 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -1
- package/README.md +12 -11
- package/README.zh-CN.md +3 -5
- package/SUBAGENT_ADAPTER_CONTRACT.md +3 -1
- package/dist/agent-profile.d.ts +18 -62
- package/dist/agent-profile.d.ts.map +1 -1
- package/dist/agent-profile.js +27 -249
- package/dist/agent-profile.js.map +1 -1
- package/dist/codecs/agent-profile.d.ts +53 -0
- package/dist/codecs/agent-profile.d.ts.map +1 -0
- package/dist/codecs/agent-profile.js +176 -0
- package/dist/codecs/agent-profile.js.map +1 -0
- package/dist/codecs/index.d.ts +5 -0
- package/dist/codecs/index.d.ts.map +1 -0
- package/dist/codecs/index.js +3 -0
- package/dist/codecs/index.js.map +1 -0
- package/dist/codecs/prompt-stack.d.ts +18 -0
- package/dist/codecs/prompt-stack.d.ts.map +1 -0
- package/dist/codecs/prompt-stack.js +479 -0
- package/dist/codecs/prompt-stack.js.map +1 -0
- package/dist/compile-cycle.d.ts +18 -0
- package/dist/compile-cycle.d.ts.map +1 -0
- package/dist/compile-cycle.js +13 -0
- package/dist/compile-cycle.js.map +1 -0
- package/dist/compiler.d.ts +10 -4
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +53 -19
- package/dist/compiler.js.map +1 -1
- package/dist/context-diff-history.d.ts +61 -0
- package/dist/context-diff-history.d.ts.map +1 -0
- package/dist/context-diff-history.js +84 -0
- package/dist/context-diff-history.js.map +1 -0
- package/dist/context-diff-snapshot.d.ts +19 -0
- package/dist/context-diff-snapshot.d.ts.map +1 -0
- package/dist/context-diff-snapshot.js +146 -0
- package/dist/context-diff-snapshot.js.map +1 -0
- package/dist/context-diff.d.ts +70 -0
- package/dist/context-diff.d.ts.map +1 -0
- package/dist/context-diff.js +259 -0
- package/dist/context-diff.js.map +1 -0
- package/dist/extension-registry.d.ts.map +1 -1
- package/dist/extension-registry.js +5 -2
- package/dist/extension-registry.js.map +1 -1
- package/dist/forge-config.d.ts +0 -105
- package/dist/forge-config.d.ts.map +1 -1
- package/dist/forge-config.js +1 -313
- package/dist/forge-config.js.map +1 -1
- package/dist/forge-v1/analyzer.d.ts +3 -0
- package/dist/forge-v1/analyzer.d.ts.map +1 -0
- package/dist/forge-v1/analyzer.js +50 -0
- package/dist/forge-v1/analyzer.js.map +1 -0
- package/dist/forge-v1/index.d.ts +6 -0
- package/dist/forge-v1/index.d.ts.map +1 -0
- package/dist/forge-v1/index.js +13 -0
- package/dist/forge-v1/index.js.map +1 -0
- package/dist/forge-v1/parser.d.ts +3 -0
- package/dist/forge-v1/parser.d.ts.map +1 -0
- package/dist/forge-v1/parser.js +186 -0
- package/dist/forge-v1/parser.js.map +1 -0
- package/dist/forge-v1/renderer.d.ts +9 -0
- package/dist/forge-v1/renderer.d.ts.map +1 -0
- package/dist/forge-v1/renderer.js +181 -0
- package/dist/forge-v1/renderer.js.map +1 -0
- package/dist/forge-v1/types.d.ts +87 -0
- package/dist/forge-v1/types.d.ts.map +1 -0
- package/dist/forge-v1/types.js +4 -0
- package/dist/forge-v1/types.js.map +1 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -83
- package/dist/index.js.map +1 -1
- package/dist/lifecycle.d.ts +8 -5
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/lifecycle.js +45 -112
- package/dist/lifecycle.js.map +1 -1
- package/dist/loader.d.ts +5 -8
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +10 -467
- package/dist/loader.js.map +1 -1
- package/dist/macro-engine.d.ts +9 -14
- package/dist/macro-engine.d.ts.map +1 -1
- package/dist/macro-engine.js +5 -238
- package/dist/macro-engine.js.map +1 -1
- package/dist/payload-capture.d.ts +10 -0
- package/dist/payload-capture.d.ts.map +1 -1
- package/dist/payload-capture.js +39 -9
- package/dist/payload-capture.js.map +1 -1
- package/dist/payload-command.d.ts +8 -6
- package/dist/payload-command.d.ts.map +1 -1
- package/dist/payload-command.js +36 -6
- package/dist/payload-command.js.map +1 -1
- package/dist/payload-state.d.ts +19 -0
- package/dist/payload-state.d.ts.map +1 -0
- package/dist/payload-state.js +19 -0
- package/dist/payload-state.js.map +1 -0
- package/dist/preset-command.d.ts +4 -4
- package/dist/preset-command.d.ts.map +1 -1
- package/dist/preset-command.js +33 -104
- package/dist/preset-command.js.map +1 -1
- package/dist/preview.d.ts +4 -4
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +34 -11
- package/dist/preview.js.map +1 -1
- package/dist/profile-command.d.ts +2 -2
- package/dist/profile-command.d.ts.map +1 -1
- package/dist/profile-command.js +15 -14
- package/dist/profile-command.js.map +1 -1
- package/dist/profile-service.d.ts.map +1 -1
- package/dist/profile-service.js +23 -39
- package/dist/profile-service.js.map +1 -1
- package/dist/prompt-analysis.d.ts +24 -0
- package/dist/prompt-analysis.d.ts.map +1 -0
- package/dist/prompt-analysis.js +84 -0
- package/dist/prompt-analysis.js.map +1 -0
- package/dist/prompt-runtime.d.ts +19 -0
- package/dist/prompt-runtime.d.ts.map +1 -0
- package/dist/prompt-runtime.js +30 -0
- package/dist/prompt-runtime.js.map +1 -0
- package/dist/regex.js +6 -12
- package/dist/regex.js.map +1 -1
- package/dist/render-helpers.d.ts +2 -10
- package/dist/render-helpers.d.ts.map +1 -1
- package/dist/render-helpers.js +3 -53
- package/dist/render-helpers.js.map +1 -1
- package/dist/repositories/agent-profile.d.ts +36 -0
- package/dist/repositories/agent-profile.d.ts.map +1 -0
- package/dist/repositories/agent-profile.js +153 -0
- package/dist/repositories/agent-profile.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -0
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +3 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/prompt-stack.d.ts +57 -0
- package/dist/repositories/prompt-stack.d.ts.map +1 -0
- package/dist/repositories/prompt-stack.js +175 -0
- package/dist/repositories/prompt-stack.js.map +1 -0
- package/dist/runtime/profile-runtime.d.ts +2 -2
- package/dist/runtime/profile-runtime.d.ts.map +1 -1
- package/dist/runtime/profile-runtime.js +13 -10
- package/dist/runtime/profile-runtime.js.map +1 -1
- package/dist/runtime/prompt-stack-runtime.d.ts +4 -3
- package/dist/runtime/prompt-stack-runtime.d.ts.map +1 -1
- package/dist/runtime/prompt-stack-runtime.js +42 -57
- package/dist/runtime/prompt-stack-runtime.js.map +1 -1
- package/dist/runtime/tool-policy-runtime.d.ts +2 -2
- package/dist/runtime/tool-policy-runtime.d.ts.map +1 -1
- package/dist/runtime/tool-policy-runtime.js +16 -6
- package/dist/runtime/tool-policy-runtime.js.map +1 -1
- package/dist/runtime/web-editor-runtime.d.ts +2 -1
- package/dist/runtime/web-editor-runtime.d.ts.map +1 -1
- package/dist/runtime/web-editor-runtime.js +8 -3
- package/dist/runtime/web-editor-runtime.js.map +1 -1
- package/dist/session-adapter.d.ts +17 -0
- package/dist/session-adapter.d.ts.map +1 -0
- package/dist/session-adapter.js +57 -0
- package/dist/session-adapter.js.map +1 -0
- package/dist/slot-renderers.d.ts +16 -3
- package/dist/slot-renderers.d.ts.map +1 -1
- package/dist/slot-renderers.js +15 -63
- package/dist/slot-renderers.js.map +1 -1
- package/dist/stack-migration.d.ts +6 -0
- package/dist/stack-migration.d.ts.map +1 -1
- package/dist/stack-migration.js +49 -52
- package/dist/stack-migration.js.map +1 -1
- package/dist/subagent/fingerprints.d.ts +24 -0
- package/dist/subagent/fingerprints.d.ts.map +1 -0
- package/dist/subagent/fingerprints.js +81 -0
- package/dist/subagent/fingerprints.js.map +1 -0
- package/dist/subagent/host-port.d.ts +296 -0
- package/dist/subagent/host-port.d.ts.map +1 -0
- package/dist/subagent/host-port.js +560 -0
- package/dist/subagent/host-port.js.map +1 -0
- package/dist/subagent/index.d.ts +10 -10
- package/dist/subagent/index.d.ts.map +1 -1
- package/dist/subagent/index.js +9 -10
- package/dist/subagent/index.js.map +1 -1
- package/dist/subagent-host.d.ts +99 -18
- package/dist/subagent-host.d.ts.map +1 -1
- package/dist/subagent-host.js +143 -146
- package/dist/subagent-host.js.map +1 -1
- package/dist/template-render.d.ts +18 -0
- package/dist/template-render.d.ts.map +1 -0
- package/dist/template-render.js +232 -0
- package/dist/template-render.js.map +1 -0
- package/dist/types.d.ts +40 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/ui-contribution/contrib-port.d.ts +170 -0
- package/dist/ui-contribution/contrib-port.d.ts.map +1 -0
- package/dist/ui-contribution/contrib-port.js +640 -0
- package/dist/ui-contribution/contrib-port.js.map +1 -0
- package/dist/ui-contribution/index.d.ts +3 -0
- package/dist/ui-contribution/index.d.ts.map +1 -0
- package/dist/ui-contribution/index.js +2 -0
- package/dist/ui-contribution/index.js.map +1 -0
- package/dist/web-editor/client-script.generated.d.ts.map +1 -1
- package/dist/web-editor/client-script.generated.js +1 -1
- package/dist/web-editor/client-script.generated.js.map +1 -1
- package/dist/web-editor/client-styles.generated.d.ts.map +1 -1
- package/dist/web-editor/client-styles.generated.js +1 -1
- package/dist/web-editor/client-styles.generated.js.map +1 -1
- package/dist/web-editor/contrib-service.d.ts +41 -0
- package/dist/web-editor/contrib-service.d.ts.map +1 -0
- package/dist/web-editor/contrib-service.js +174 -0
- package/dist/web-editor/contrib-service.js.map +1 -0
- package/dist/web-editor/line-diff.d.ts +28 -0
- package/dist/web-editor/line-diff.d.ts.map +1 -0
- package/dist/web-editor/line-diff.js +216 -0
- package/dist/web-editor/line-diff.js.map +1 -0
- package/dist/web-editor/schema-form.d.ts +63 -0
- package/dist/web-editor/schema-form.d.ts.map +1 -0
- package/dist/web-editor/schema-form.js +213 -0
- package/dist/web-editor/schema-form.js.map +1 -0
- package/dist/web-editor/server.d.ts.map +1 -1
- package/dist/web-editor/server.js +72 -74
- package/dist/web-editor/server.js.map +1 -1
- package/dist/web-editor/styles.d.ts.map +1 -1
- package/dist/web-editor/styles.js +201 -21
- package/dist/web-editor/styles.js.map +1 -1
- package/dist/web-editor/types.d.ts +12 -35
- package/dist/web-editor/types.d.ts.map +1 -1
- package/dist/web-host.d.ts +6 -2
- package/dist/web-host.d.ts.map +1 -1
- package/dist/web-host.js +33 -103
- package/dist/web-host.js.map +1 -1
- package/dist/workspace.d.ts +74 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +351 -0
- package/dist/workspace.js.map +1 -0
- package/docs/README.md +7 -4
- package/docs/concepts/agent-profiles.md +1 -1
- package/docs/concepts/prompt-stacks.md +5 -5
- package/docs/design/0.5.1-plan.md +237 -0
- package/docs/design/README.md +21 -3
- package/docs/design/architecture-0.5.md +222 -0
- package/docs/design/archive/0.5-full-proposal/0.5-consumer-audit.md +62 -0
- package/docs/design/archive/0.5-full-proposal/0.5-inventory.md +208 -0
- package/docs/design/archive/0.5-full-proposal/0.5-phase0-decision-drafts.md +237 -0
- package/docs/design/archive/0.5-full-proposal/README.md +12 -0
- package/docs/design/archive/0.5-full-proposal/architecture-0.5.md +423 -0
- package/docs/design/archive/0.5-full-proposal/host-discovery-spike.md +103 -0
- package/docs/design/archive/0.5-full-proposal/template-language-spike.md +156 -0
- package/docs/design/context-diff-plan.md +78 -0
- package/docs/design/decision-template.md +33 -0
- package/docs/design/roadmap-0.4-archive.md +1 -1
- package/docs/design/subagents/interface-design.md +1 -1
- package/docs/development/architecture-rules.md +148 -0
- package/docs/development/release.md +7 -1
- package/docs/development/roadmap.md +37 -5
- package/docs/development/scoped-global-profiles-stacks.md +1 -1
- package/docs/development/setup.md +6 -4
- package/docs/getting-started.md +5 -4
- package/docs/guides/custom-macros-and-slots.md +8 -7
- package/docs/guides/debugging.md +1 -1
- package/docs/guides/delegation.md +18 -22
- package/docs/guides/migrating-to-0.5.md +107 -0
- package/docs/guides/use-cases.md +7 -11
- package/docs/guides/web-editor.md +6 -10
- package/docs/reference/commands.md +4 -3
- package/docs/reference/configuration.md +17 -18
- package/docs/reference/features.md +34 -80
- package/docs/reference/macros-and-slots.md +70 -49
- package/docs/reference/public-api.md +76 -17
- package/docs/reference/stack-schema.md +15 -10
- package/docs/reference/subagent-host-port.md +49 -0
- package/docs/reference/ui-contribution-port.md +51 -0
- package/docs/zh-CN/README.md +3 -3
- package/docs/zh-CN/concepts/agent-profiles.md +1 -1
- package/docs/zh-CN/concepts/prompt-stacks.md +5 -5
- package/docs/zh-CN/getting-started.md +3 -2
- package/docs/zh-CN/guides/delegation.md +10 -12
- package/docs/zh-CN/guides/migrating-to-0.5.md +92 -0
- package/docs/zh-CN/guides/web-editor.md +4 -4
- package/docs/zh-CN/reference/commands.md +3 -2
- package/examples/custom-system-status-extension/README.md +3 -3
- package/examples/custom-system-status-extension/index.ts +2 -1
- package/examples/custom-system-status-extension/prompt-stack.json +4 -3
- package/examples/default-prompt-stack.json +9 -4
- package/examples/image-reader-prompt-stack.json +16 -26
- package/examples/reviewer-prompt-stack.json +13 -24
- package/package.json +106 -120
- package/dist/runtime/subagent-runtime.d.ts +0 -45
- package/dist/runtime/subagent-runtime.d.ts.map +0 -1
- package/dist/runtime/subagent-runtime.js +0 -343
- package/dist/runtime/subagent-runtime.js.map +0 -1
- package/dist/runtime-state.d.ts +0 -30
- package/dist/runtime-state.d.ts.map +0 -1
- package/dist/runtime-state.js +0 -17
- package/dist/runtime-state.js.map +0 -1
- package/dist/sillytavern-importer/items.d.ts +0 -3
- package/dist/sillytavern-importer/items.d.ts.map +0 -1
- package/dist/sillytavern-importer/items.js +0 -88
- package/dist/sillytavern-importer/items.js.map +0 -1
- package/dist/sillytavern-importer/macros.d.ts +0 -15
- package/dist/sillytavern-importer/macros.d.ts.map +0 -1
- package/dist/sillytavern-importer/macros.js +0 -141
- package/dist/sillytavern-importer/macros.js.map +0 -1
- package/dist/sillytavern-importer/prompt-order.d.ts +0 -6
- package/dist/sillytavern-importer/prompt-order.d.ts.map +0 -1
- package/dist/sillytavern-importer/prompt-order.js +0 -38
- package/dist/sillytavern-importer/prompt-order.js.map +0 -1
- package/dist/sillytavern-importer/regex.d.ts +0 -3
- package/dist/sillytavern-importer/regex.d.ts.map +0 -1
- package/dist/sillytavern-importer/regex.js +0 -275
- package/dist/sillytavern-importer/regex.js.map +0 -1
- package/dist/sillytavern-importer/report.d.ts +0 -21
- package/dist/sillytavern-importer/report.d.ts.map +0 -1
- package/dist/sillytavern-importer/report.js +0 -166
- package/dist/sillytavern-importer/report.js.map +0 -1
- package/dist/sillytavern-importer/types.d.ts +0 -106
- package/dist/sillytavern-importer/types.d.ts.map +0 -1
- package/dist/sillytavern-importer/types.js +0 -2
- package/dist/sillytavern-importer/types.js.map +0 -1
- package/dist/sillytavern-importer.d.ts +0 -5
- package/dist/sillytavern-importer.d.ts.map +0 -1
- package/dist/sillytavern-importer.js +0 -117
- package/dist/sillytavern-importer.js.map +0 -1
- package/dist/subagent/canonical.d.ts +0 -22
- package/dist/subagent/canonical.d.ts.map +0 -1
- package/dist/subagent/canonical.js +0 -24
- package/dist/subagent/canonical.js.map +0 -1
- package/dist/subagent/context.d.ts +0 -8
- package/dist/subagent/context.d.ts.map +0 -1
- package/dist/subagent/context.js +0 -125
- package/dist/subagent/context.js.map +0 -1
- package/dist/subagent/contract.d.ts +0 -10
- package/dist/subagent/contract.d.ts.map +0 -1
- package/dist/subagent/contract.js +0 -10
- package/dist/subagent/contract.js.map +0 -1
- package/dist/subagent/plan.d.ts +0 -18
- package/dist/subagent/plan.d.ts.map +0 -1
- package/dist/subagent/plan.js +0 -157
- package/dist/subagent/plan.js.map +0 -1
- package/dist/subagent/preflight.d.ts +0 -4
- package/dist/subagent/preflight.d.ts.map +0 -1
- package/dist/subagent/preflight.js +0 -108
- package/dist/subagent/preflight.js.map +0 -1
- package/dist/subagent/request.d.ts +0 -4
- package/dist/subagent/request.d.ts.map +0 -1
- package/dist/subagent/request.js +0 -154
- package/dist/subagent/request.js.map +0 -1
- package/dist/subagent/response.d.ts +0 -8
- package/dist/subagent/response.d.ts.map +0 -1
- package/dist/subagent/response.js +0 -155
- package/dist/subagent/response.js.map +0 -1
- package/dist/subagent/tools.d.ts +0 -4
- package/dist/subagent/tools.d.ts.map +0 -1
- package/dist/subagent/tools.js +0 -42
- package/dist/subagent/tools.js.map +0 -1
- package/dist/subagent/types.d.ts +0 -272
- package/dist/subagent/types.d.ts.map +0 -1
- package/dist/subagent/types.js +0 -3
- package/dist/subagent/types.js.map +0 -1
- package/dist/subagent/validation.d.ts +0 -35
- package/dist/subagent/validation.d.ts.map +0 -1
- package/dist/subagent/validation.js +0 -314
- package/dist/subagent/validation.js.map +0 -1
- package/dist/subagent-command.d.ts +0 -5
- package/dist/subagent-command.d.ts.map +0 -1
- package/dist/subagent-command.js +0 -249
- package/dist/subagent-command.js.map +0 -1
- package/dist/subagent-profile-tool.d.ts +0 -49
- package/dist/subagent-profile-tool.d.ts.map +0 -1
- package/dist/subagent-profile-tool.js +0 -125
- package/dist/subagent-profile-tool.js.map +0 -1
- package/dist/subagent-tool.d.ts +0 -77
- package/dist/subagent-tool.d.ts.map +0 -1
- package/dist/subagent-tool.js +0 -559
- package/dist/subagent-tool.js.map +0 -1
- package/docs/guides/sillytavern-import.md +0 -47
- package/docs/reference/subagent-adapter.md +0 -204
- package/examples/sillytavern-dm-writer-prompt-stack.json +0 -190
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# 0.5.0 migration inventory
|
|
2
|
+
|
|
3
|
+
[Design index](README.md) · [0.5 architecture plan](architecture-0.5.md) · [Architecture rules](../../../development/architecture-rules.md)
|
|
4
|
+
|
|
5
|
+
Status: Phase 0 evidence; not an accepted architecture decision
|
|
6
|
+
|
|
7
|
+
Date: 2026-08-17
|
|
8
|
+
|
|
9
|
+
This inventory records the 0.4.1 surfaces that 0.5 must retain, migrate, remove,
|
|
10
|
+
or deliberately replace. It is a characterization aid, not a promise to preserve
|
|
11
|
+
every current behavior. The 0.5 plan remains authoritative, and a maintainer must
|
|
12
|
+
accept any new boundary or product decision before implementation.
|
|
13
|
+
|
|
14
|
+
## Snapshot and method
|
|
15
|
+
|
|
16
|
+
The inventory is based on tracked source, tests, the package manifest, and
|
|
17
|
+
documentation at commit `5b56096`. It lists in-repository consumers and
|
|
18
|
+
documented integration surfaces. It cannot establish unknown downstream npm
|
|
19
|
+
consumers; that check remains a Phase 6 release task.
|
|
20
|
+
|
|
21
|
+
| Area | Current evidence | 0.5 disposition |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| Prompt stacks | Schema v1 files, project/global catalogs, legacy project read path, compiler, macros, slots, regex, tool/skill policy | Keep as v2 compiler/resource work; remove mutable variables; audit finalized regex; retire legacy storage compatibility on the documented path |
|
|
24
|
+
| Agent profiles | Schema v1 files, project/global catalogs, model/thinking/stack preflight, apply, provenance, drift | Keep as a separate domain and service; introduce v2 only if storage changes |
|
|
25
|
+
| Runtime state | One `PiForgeRuntimeState` owns resources, lifecycle values, presentation/debug state, and variables | Replace with workspace-owned resource snapshot plus separate adapter state slices |
|
|
26
|
+
| Browser editor | Token-gated localhost HTTP server; host performs resource workflows and direct writes | Retain as an adapter; move resource mutation and validation into services/repositories |
|
|
27
|
+
| Subagents | Main extension registers commands/tools and directly depends on `@zihanw/pi-subagent-runtime` | Extract as optional package behind a versioned public host port |
|
|
28
|
+
| SillyTavern | Import command, converter, report, guide, example, tests | Remove completely; require conversion on 0.4 before upgrading |
|
|
29
|
+
| Package surface | Root exports, `/subagent`, and `src/*` compatibility patterns | Replace with explicit 0.5 entries; retain only intentional public ports |
|
|
30
|
+
|
|
31
|
+
## Public package and extension surfaces
|
|
32
|
+
|
|
33
|
+
### Package manifest
|
|
34
|
+
|
|
35
|
+
- Package: `@zihanw/pi-forge` 0.4.1; Pi entry: `dist/index.js`.
|
|
36
|
+
- Public exports: package root, `@zihanw/pi-forge/subagent`, examples, and broad
|
|
37
|
+
compiled `@zihanw/pi-forge/src/*` compatibility aliases. Browser client paths
|
|
38
|
+
are explicitly blocked.
|
|
39
|
+
- Pi SDK packages and `typebox` are optional wildcard peers. The repository's
|
|
40
|
+
development fixture is Pi 0.83.0; no minimum or tested Pi range is published.
|
|
41
|
+
- `@zihanw/pi-subagent-runtime@0.1.0-beta.2` is currently a hard dependency.
|
|
42
|
+
- `PUBLIC_API.md` and `SUBAGENT_ADAPTER_CONTRACT.md` are npm-published root
|
|
43
|
+
compatibility pointers to the authoritative reference documentation. Their
|
|
44
|
+
0.5 package-file and redirect status is not yet decided.
|
|
45
|
+
|
|
46
|
+
### Root exports grouped by intent
|
|
47
|
+
|
|
48
|
+
| Current surface | Evidence / consumer | 0.5 review action |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| Default Pi extension factory | `src/index.ts`; `pi.extensions` manifest | Keep as main package entry point |
|
|
51
|
+
| Resource identity/catalog/loader helpers | Root barrel and tests | Decide whether each is a stable domain export or internal |
|
|
52
|
+
| Macro/slot registration and Forge extension API | Root barrel; custom-system-status example and guide | Preserve only as an intentional trusted-extension port, compatible with immutable compilation |
|
|
53
|
+
| Profile repository/resolution/application APIs | Root barrel and profile tests | Replace experimental APIs with deliberate service/domain exports if external consumers exist |
|
|
54
|
+
| Subagent contract and host preparation helpers | Root compatibility re-exports and `/subagent` entry | Keep `/subagent`, but replace its current internal host-preparation surface with a versioned port |
|
|
55
|
+
| `src/*` aliases | Documentation and package checks | Remove in Phase 6 after consumer audit and migration notice |
|
|
56
|
+
|
|
57
|
+
The only in-repository package-style import is the public-API test of
|
|
58
|
+
`@zihanw/pi-forge/subagent`. Documentation identifies trusted macro/slot
|
|
59
|
+
extension authors as intended consumers. No external consumer audit is recorded.
|
|
60
|
+
|
|
61
|
+
### Phase-0 public-surface decision register
|
|
62
|
+
|
|
63
|
+
This is the required decision format for the final public-surface review. The
|
|
64
|
+
listed dispositions are provisional until consumer audit and maintainer review;
|
|
65
|
+
Phase 6 must execute this register rather than make API decisions while deleting
|
|
66
|
+
exports.
|
|
67
|
+
|
|
68
|
+
| 0.4 surface group | Candidate 0.5 disposition | Target entry point / migration | Known consumer | Decision status |
|
|
69
|
+
|---|---|---|---|---|
|
|
70
|
+
| Default extension factory | Stable | Package root default export | Pi package manifest | Provisional: retain |
|
|
71
|
+
| Macro/slot and trusted Forge extension registration | Stable or experimental | Deliberate main-package extension port | Custom-system-status example; documented trusted extension authors | Pending compiler-extension contract |
|
|
72
|
+
| Resource identity/catalog/loader helpers | Internal unless a named consumer requires a domain port | No `src/*` replacement by default | Root barrel and tests only | Pending consumer audit |
|
|
73
|
+
| Profile repository/resolution/application helpers | Experimental or internal | Deliberate service/domain entry only if justified | Root barrel and tests only | Pending service boundary and consumer audit |
|
|
74
|
+
| `/subagent` host contract | Versioned experimental host port | `@zihanw/pi-forge/subagent` | Public-API test; future optional extension | Pending host-discovery decision |
|
|
75
|
+
| Root re-exports of subagent names | Remove or retain only as one-release migration shim | Direct consumers to `/subagent` | 0.4 compatibility policy | Pending consumer audit and migration decision |
|
|
76
|
+
| `src/*` aliases | Remove | Intentional entries only | Compatibility documentation | Planned removal in Phase 6 |
|
|
77
|
+
| `PUBLIC_API.md` and `SUBAGENT_ADAPTER_CONTRACT.md` | Retain as package pointers or replace with package-local index | Decide published-file policy with the final entries | `files` allowlist and current documentation | Pending Phase 6 public-doc decision |
|
|
78
|
+
|
|
79
|
+
## Persisted resources and state
|
|
80
|
+
|
|
81
|
+
### Resource files
|
|
82
|
+
|
|
83
|
+
| Resource | Locations | Schema / current behavior | Migration concern |
|
|
84
|
+
|---|---|---|---|
|
|
85
|
+
| Prompt stack | Project `.pi/forge/prompt-stacks/*.json`; global `~/.pi/forge/prompt-stacks/*.json`; legacy project `.pi/prompt-stacks/*.json` read path | v1 `PromptStack`; scoped project-over-global resolution; loader normalizes and validates | Define v1→v2 codec, retained regex fields, `variables`→immutable `parameters`, conflict/backup behavior, and final legacy-path removal |
|
|
86
|
+
| Agent profile | Project `.pi/forge/agent-profiles/*.json`; global `~/.pi/forge/agent-profiles/*.json` | v1 `pi-forge.agent-profile`; model, thinking level, relative scoped stack reference, optional auto-activation | Preserve IDs/scoped references where possible; decide whether v2 is needed and document any rewrite |
|
|
87
|
+
| Main-package configuration | Project/global `.pi/forge/config.json` | `webEditor.port` | Main package owns the editor setting; keep it outside stack/profile repositories |
|
|
88
|
+
| Subagent configuration | Currently project/global `.pi/forge/config.json`, `subagents.*` | Defaults, per-profile authorization, backend/timeout, unattended invocation and summary flag | Open: optional package must own parsing, validation, writes, and migration; decide whether it remains a namespaced shared file or moves to a dedicated file |
|
|
89
|
+
| Trusted Forge extensions | Project/global `.pi/forge/extensions/*.{ts,js,mjs,cjs}` | Executable macro/slot registrations, loaded on trusted projects | Workspace owns registration lifecycle; compiler v2 must define the replacement extension contract |
|
|
90
|
+
| Payload captures | User-selected path, commonly `.pi/forge/payloads/last.json` | Redacted provider payload, potentially sensitive | Presentation/debug artifact, not workspace resource state |
|
|
91
|
+
|
|
92
|
+
### Pi session custom entries
|
|
93
|
+
|
|
94
|
+
| Entry type | Stored data | Current restoration | 0.5 requirement |
|
|
95
|
+
|---|---|---|---|
|
|
96
|
+
| `pi-forge-prompt-stack-state` | `activeStackId` | Latest branch entry selects scoped active stack | Version/restoration and v1 selector migration policy |
|
|
97
|
+
| `pi-forge-agent-profile-state` | Profile provenance or `null` | Latest branch entry drives drift status; does not reapply profile | Version/restoration policy and compatibility with profile schema changes |
|
|
98
|
+
| `pi-forge-variable-state` | Mutable session variables | Latest branch entry restores variables | Remove and provide an explicit ignored/diagnostic migration path; do not write a replacement |
|
|
99
|
+
|
|
100
|
+
These entry payloads have no explicit version today. This requires a state
|
|
101
|
+
decision and migration notes under the architecture rules.
|
|
102
|
+
|
|
103
|
+
## Runtime ownership and Pi coupling
|
|
104
|
+
|
|
105
|
+
`PiForgeRuntimeState` currently holds stacks, profiles, active selection,
|
|
106
|
+
profile provenance, compile inputs/variables, diagnostics, Forge-extension
|
|
107
|
+
registration metadata, payload capture, and browser-facing state. Its users span
|
|
108
|
+
the stack, profile, policy, web-editor, payload, lifecycle, and subagent paths.
|
|
109
|
+
|
|
110
|
+
| Pi coupling | Current owner / use | 0.5 target |
|
|
111
|
+
|---|---|---|
|
|
112
|
+
| Lifecycle | Session, resource-discovery, tree/compact/shutdown, input/turn, compilation/context and message events | Pi adapter translates events to workspace/services and owns adapter-only transient state |
|
|
113
|
+
| Compilation | `before_agent_start` and `context` provide live Pi context, clock, system options and messages | Normalize inputs once into immutable `PromptEnvironment`; preview and runtime share the compiler |
|
|
114
|
+
| Tool policy | Pi active-tool APIs plus input/turn reassertion and tool-call guard | `ToolPolicyPort`; preserve baseline reconciliation with other extensions |
|
|
115
|
+
| Profile application | Pi model/thinking setters plus active-stack mutation and rollback | Runtime-controller port with preflight and documented compensation semantics |
|
|
116
|
+
| Extension registrations | Forge loader mutates macro/slot registries | Workspace-coordinated trusted registration lifecycle, without core importing Pi adapters |
|
|
117
|
+
| Subagents | Main extension creates runtime/backends and reads shared state | Optional extension calls only the versioned Forge host capability |
|
|
118
|
+
|
|
119
|
+
## Commands, tools, and HTTP adapter surface
|
|
120
|
+
|
|
121
|
+
| Surface | Current operations | 0.5 disposition |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `/preset` | List, status, use/disable, preview, validate, diagnostics, reload, UI, legacy migration, SillyTavern import | Keep ordinary stack operations as service calls; remove legacy migration command after documented migration and remove SillyTavern command |
|
|
124
|
+
| `/profile` | List, use, save, status, preview, validate, reload, forget | Keep as thin profile-service adapter |
|
|
125
|
+
| `/payload` and `/intercept` | Arm/display/save redacted next provider payload | Keep as separate debug/presentation slice; decide path-safety independently of domain resources |
|
|
126
|
+
| `/forge-agent` | Backends, dry plan, approved run | Move with optional subagent integration |
|
|
127
|
+
| `forge_subagent_profiles` and `forge_subagent` | Enabled-profile discovery and foreground delegation | Move with optional subagent integration |
|
|
128
|
+
| Local editor HTTP API | Stack/profile list/get/validate/create/save/delete/apply/reload/activate; resources; payload; delegation config | Retain token-gated localhost adapter; map typed service results to HTTP and remove workflow/persistence from web host |
|
|
129
|
+
|
|
130
|
+
The editor binds to `127.0.0.1`, uses a per-server random token, and accepts the
|
|
131
|
+
token in the query/header. Browser source remains under `src/web-editor/client/`;
|
|
132
|
+
generated embedded assets must not be hand edited.
|
|
133
|
+
|
|
134
|
+
## Current resource mutation locations
|
|
135
|
+
|
|
136
|
+
| Location | Current mutation | Phase 1 target |
|
|
137
|
+
|---|---|---|
|
|
138
|
+
| `web-host.ts` | Stack/profile/config reads and writes, deletes, creation, import routing | Adapter invokes repositories/services only |
|
|
139
|
+
| `profile-service.ts` | Profile create/write/delete | Move filesystem behavior to profile repository and codec |
|
|
140
|
+
| `preset-command.ts` | SillyTavern converted stack/report writes | Remove with SillyTavern surface |
|
|
141
|
+
| `stack-migration.ts` | Legacy stack copy/delete | Retire after the documented pre-0.5 migration path |
|
|
142
|
+
| `forge-config.ts` | Configuration writes | Separately owned configuration concern unless explicitly redesigned |
|
|
143
|
+
| `payload-command.ts` | User-requested payload file write | Debug artifact, not a domain-resource repository |
|
|
144
|
+
|
|
145
|
+
Current resource mutation has path-containment and symlink checks in several
|
|
146
|
+
paths, but replacement writes are not uniformly atomic and stack mutations do
|
|
147
|
+
not uniformly carry expected fingerprints. Phase 1 must characterize these
|
|
148
|
+
behaviors before changing them.
|
|
149
|
+
|
|
150
|
+
## Tooling and verification surface
|
|
151
|
+
|
|
152
|
+
| Tooling | Current enforcement | 0.5 review action |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| `scripts/check-package.mjs` | Package tarball layout, wildcard Pi peers, `src/*` compatibility exports, blocked browser paths | Update with final explicit entry points and root compatibility-pointer policy in Phase 6 |
|
|
155
|
+
| `scripts/check-dist.mjs` | Generated `dist/` matches authored source | Update only alongside intentional source/package layout changes |
|
|
156
|
+
| `scripts/check-docs.mjs` | Local documentation-link validation | Keep links current as 0.5 guides, migration material, and redirects replace 0.4 documentation |
|
|
157
|
+
| `scripts/build-web-client.mjs` | Generated embedded browser script/style synchronization | Preserve; regenerate only from authored `src/web-editor/client/` changes |
|
|
158
|
+
| Public API and package tests | Root/subagent export compatibility and packed-entry behavior | Replace 0.4 compatibility assertions with the accepted public-surface register in Phase 6 |
|
|
159
|
+
|
|
160
|
+
`package.json` scripts, the browser suite, build/type checks, and packed-install
|
|
161
|
+
smoke tests are part of the release evidence. The final verification matrix must
|
|
162
|
+
test the documented Pi range with and without the optional subagent package.
|
|
163
|
+
|
|
164
|
+
## Documentation, examples, and characterization coverage
|
|
165
|
+
|
|
166
|
+
### Released documentation requiring a 0.5 review
|
|
167
|
+
|
|
168
|
+
- Prompt-stack schema, macro/slot, agent-profile, configuration, command,
|
|
169
|
+
debugging, delegation, web-editor, getting-started, public-API, and subagent
|
|
170
|
+
contract documentation.
|
|
171
|
+
- English and Chinese user guides. Chinese internal architecture documentation
|
|
172
|
+
is not required by the plan, but user-facing breaking changes are.
|
|
173
|
+
|
|
174
|
+
### Examples and tests requiring disposition
|
|
175
|
+
|
|
176
|
+
| Item | 0.5 action |
|
|
177
|
+
|---|---|
|
|
178
|
+
| Default, image-reader, reviewer, and validation prompt-stack examples | Revalidate or migrate against schema v2 |
|
|
179
|
+
| Custom system-status extension | Retain only if it conforms to the replacement template/slot extension port |
|
|
180
|
+
| SillyTavern example, importer fixtures/tests, and guide | Remove after final 0.4 conversion path is documented |
|
|
181
|
+
| Compiler, profile, catalog, policy, lifecycle, web-editor, and subagent tests | Preserve as characterization coverage until the responsible phase replaces them |
|
|
182
|
+
| Browser editor tests | Keep through adapter migration; regenerate client assets when authored client code changes |
|
|
183
|
+
|
|
184
|
+
## Phase-0 open work and exit evidence
|
|
185
|
+
|
|
186
|
+
1. Record maintainer acceptance or amendment status for the proposed 0.5 plan.
|
|
187
|
+
2. The [external-consumer audit](0.5-consumer-audit.md) is complete with an
|
|
188
|
+
explicit unauthenticated-search limitation. Repeat it with maintainer access
|
|
189
|
+
before Phase 6 removes exports or compatibility paths.
|
|
190
|
+
3. The [template-language spike](template-language-spike.md) is complete.
|
|
191
|
+
Accept its grammar, environment, extension-port, schema, and migration
|
|
192
|
+
decisions before Phase 3.
|
|
193
|
+
4. The [Pi host-discovery spike](host-discovery-spike.md) is complete.
|
|
194
|
+
Accept its event-bus host-port protocol, operation catalogue, versioning, and
|
|
195
|
+
lifecycle rules before Phase 5.
|
|
196
|
+
5. Establish a supported Pi version range and packed-install test matrix.
|
|
197
|
+
6. Decide Pi session custom-entry versioning and restoration semantics for
|
|
198
|
+
prompt-stack state, profile state, and removed variable state.
|
|
199
|
+
7. Decide main-package versus optional-subagent ownership and storage migration
|
|
200
|
+
for `webEditor.*` and `subagents.*` configuration.
|
|
201
|
+
8. Complete and accept the public-surface decision register before Phase 6.
|
|
202
|
+
9. Turn repository/reload, profile-application, finalized-regex,
|
|
203
|
+
migration-artifact, and physical-package questions into accepted decisions
|
|
204
|
+
before their affected implementation phases.
|
|
205
|
+
|
|
206
|
+
Phase 0 exits only when this removal/migration inventory and the resulting
|
|
207
|
+
decisions are reviewed. This inventory alone authorizes no implementation
|
|
208
|
+
boundary changes.
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# 0.5.0 Phase-0 decision drafts
|
|
2
|
+
|
|
3
|
+
[Design index](README.md) · [Architecture decision template](../../decision-template.md) · [Migration inventory](0.5-inventory.md)
|
|
4
|
+
|
|
5
|
+
Status: proposed drafts; requires maintainer acceptance
|
|
6
|
+
|
|
7
|
+
Date: 2026-08-17
|
|
8
|
+
|
|
9
|
+
This document packages the remaining Phase-0 choices for review. It does not
|
|
10
|
+
authorize code, schema, package, or persistence changes. Each accepted section
|
|
11
|
+
may become a focused architecture decision or an amendment to the 0.5 plan.
|
|
12
|
+
|
|
13
|
+
## D1: Pi compatibility and release matrix
|
|
14
|
+
|
|
15
|
+
### Candidate decision
|
|
16
|
+
|
|
17
|
+
Support Pi 0.83.0 as the initial documented minimum, because it is the checked
|
|
18
|
+
development fixture and supplies the extension/event APIs used by pi-forge.
|
|
19
|
+
Treat compatibility as a rolling list of explicitly tested Pi versions, not a
|
|
20
|
+
semver range inferred from wildcard peers. Test 0.83.0 and npm `latest` (0.84.2
|
|
21
|
+
when this draft was written) for every 0.5 release candidate, including packed
|
|
22
|
+
main-only and main-plus-optional-subagent installs. Keep Pi packages as wildcard
|
|
23
|
+
optional peers so Pi supplies one coherent SDK instance.
|
|
24
|
+
|
|
25
|
+
### Alternatives
|
|
26
|
+
|
|
27
|
+
- Claim every Pi version through a semver range: reject, because wildcard peers
|
|
28
|
+
and Pi's frequent 0.x releases do not prove behavioral compatibility.
|
|
29
|
+
- Pin Pi dependencies inside pi-forge: reject, because it risks duplicate Pi
|
|
30
|
+
runtimes and conflicts with Pi package loading.
|
|
31
|
+
|
|
32
|
+
### Acceptance evidence
|
|
33
|
+
|
|
34
|
+
Document exact tested versions, Node version, packed-install commands, and
|
|
35
|
+
main-only/optional-package results in release notes. Run a scheduled latest-Pi
|
|
36
|
+
probe that reports compatibility but does not silently widen the supported list.
|
|
37
|
+
|
|
38
|
+
## D2: Pi session custom-entry versioning
|
|
39
|
+
|
|
40
|
+
### Candidate decision
|
|
41
|
+
|
|
42
|
+
Keep the existing prompt-stack and profile custom entry types, but make every
|
|
43
|
+
newly written payload an envelope with `schemaVersion: 1`. Read unversioned 0.4
|
|
44
|
+
entries through explicit legacy decoders only; do not rewrite historical Pi JSONL
|
|
45
|
+
entries. Ignore unknown versions and malformed entries with a bounded diagnostic.
|
|
46
|
+
|
|
47
|
+
The latest valid entry in the active branch remains authoritative. Restoring a
|
|
48
|
+
selector or provenance must never apply a profile or mutate Pi runtime state.
|
|
49
|
+
`pi-forge-variable-state` is never restored or written in 0.5; its presence
|
|
50
|
+
produces one migration diagnostic per restoration, not a variable store.
|
|
51
|
+
|
|
52
|
+
### Alternatives
|
|
53
|
+
|
|
54
|
+
- Rename all custom entry types: reject unless a real collision requires it;
|
|
55
|
+
existing type names are useful migration anchors.
|
|
56
|
+
- Continue unversioned free-form payloads: reject; it violates the state rules.
|
|
57
|
+
- Automatically append replacement entries while restoring: reject; opening a
|
|
58
|
+
historical session must not mutate it.
|
|
59
|
+
|
|
60
|
+
### Acceptance evidence
|
|
61
|
+
|
|
62
|
+
Characterization tests cover legacy/current/unknown/malformed entries, branch
|
|
63
|
+
selection, compaction/tree navigation, missing resources, and no variable-state
|
|
64
|
+
resurrection.
|
|
65
|
+
|
|
66
|
+
## D3: configuration ownership after subagent extraction
|
|
67
|
+
|
|
68
|
+
### Candidate decision
|
|
69
|
+
|
|
70
|
+
The main package owns `webEditor.*` in `.pi/forge/config.json` and its global
|
|
71
|
+
equivalent. The optional package owns all subagent configuration, parsing,
|
|
72
|
+
validation, mutation, and diagnostics in dedicated
|
|
73
|
+
`.pi/forge/subagents.json` and `~/.pi/forge/subagents.json` files. Main pi-forge
|
|
74
|
+
does not read, write, validate, or surface subagent policy when the optional
|
|
75
|
+
package is absent.
|
|
76
|
+
|
|
77
|
+
The optional package may read the 0.4 `config.json.subagents` section only in a
|
|
78
|
+
one-time migration mode. It writes no automatic migration, preserves the legacy
|
|
79
|
+
section, and reports conflicts rather than merging silently.
|
|
80
|
+
|
|
81
|
+
### Alternatives
|
|
82
|
+
|
|
83
|
+
- Keep a shared `config.json` namespaced section: lower migration cost, but
|
|
84
|
+
creates shared-file coordination and leaves main-package ownership ambiguous.
|
|
85
|
+
- Preserve main-package parsing of `subagents.*`: reject; it contradicts the
|
|
86
|
+
optional package boundary.
|
|
87
|
+
|
|
88
|
+
### Acceptance evidence
|
|
89
|
+
|
|
90
|
+
Test absent optional package, untrusted project, project/global precedence,
|
|
91
|
+
legacy-config migration, conflict reporting, and deletion/config cleanup.
|
|
92
|
+
|
|
93
|
+
## D4: resource repositories and workspace snapshots
|
|
94
|
+
|
|
95
|
+
### Candidate decision
|
|
96
|
+
|
|
97
|
+
Repositories own all stack/profile discovery and mutation. A codec is the only
|
|
98
|
+
source of parse, normalize, validate, serialize, and content fingerprint logic.
|
|
99
|
+
Every write/delete receives an expected fingerprint when replacing an existing
|
|
100
|
+
resource; mismatch returns a typed conflict without writing.
|
|
101
|
+
|
|
102
|
+
`ForgeWorkspace` serializes reloads and publishes an immutable complete
|
|
103
|
+
snapshot with a monotonic revision. There is no filesystem watcher in 0.5:
|
|
104
|
+
explicit reload and existing lifecycle-driven reload are the only refresh paths.
|
|
105
|
+
Invalid/missing resources appear as diagnostics in the published snapshot, while
|
|
106
|
+
resolution and activation fail closed. A selected active resource that becomes
|
|
107
|
+
invalid or disappears is not active until a later complete reload resolves it.
|
|
108
|
+
|
|
109
|
+
Filesystem repositories use temp-file-plus-rename replacement where supported,
|
|
110
|
+
validate containment before every mutation, and clean failed temporary files.
|
|
111
|
+
|
|
112
|
+
### Alternatives
|
|
113
|
+
|
|
114
|
+
- Keep synchronous adapter writes: reject; it preserves duplicate persistence
|
|
115
|
+
workflows and bypasses consistent conflict handling.
|
|
116
|
+
- Publish each catalog independently: reject; profiles could resolve against a
|
|
117
|
+
different stack generation.
|
|
118
|
+
- Add file watching during the refactor: defer; it is a new state/lifecycle
|
|
119
|
+
feature outside 0.5 scope.
|
|
120
|
+
|
|
121
|
+
### Acceptance evidence
|
|
122
|
+
|
|
123
|
+
Test external edit conflicts, atomic-write failures, reload serialization,
|
|
124
|
+
mixed valid/invalid catalogs, scoped shadowing, active deletion, and consumers
|
|
125
|
+
never observing half a stack/profile graph.
|
|
126
|
+
|
|
127
|
+
## D5: profile-application transaction semantics
|
|
128
|
+
|
|
129
|
+
### Candidate decision
|
|
130
|
+
|
|
131
|
+
`AgentProfileService` resolves and validates model, authentication, thinking,
|
|
132
|
+
stack, and tool policy before any Pi mutation. It delegates mutations to a
|
|
133
|
+
runtime-controller port in this order: model, thinking level, active stack/tool
|
|
134
|
+
policy. It records provenance only after all three succeed.
|
|
135
|
+
|
|
136
|
+
On failure, the service compensates in reverse order using the captured prior
|
|
137
|
+
state and reports every failed compensation. This is a best-effort transaction,
|
|
138
|
+
not an atomic Pi-host transaction; an unset prior model that Pi cannot restore
|
|
139
|
+
is an explicit residual failure. Adapters render the typed result but do not
|
|
140
|
+
attempt their own rollback.
|
|
141
|
+
|
|
142
|
+
### Alternatives
|
|
143
|
+
|
|
144
|
+
- Call Pi setters directly from commands/web handlers: reject; it duplicates
|
|
145
|
+
transaction behavior.
|
|
146
|
+
- Describe this as atomic: reject; Pi setters have externally visible effects
|
|
147
|
+
and no common rollback primitive.
|
|
148
|
+
|
|
149
|
+
### Acceptance evidence
|
|
150
|
+
|
|
151
|
+
Integration tests cover each failure point, unexpected thinking-level clamp,
|
|
152
|
+
missing stack after preflight, rollback failure, provenance write timing, and
|
|
153
|
+
browser/command equivalence.
|
|
154
|
+
|
|
155
|
+
## D6: regex and v1-to-v2 migration
|
|
156
|
+
|
|
157
|
+
### Candidate decision
|
|
158
|
+
|
|
159
|
+
Retain deterministic outgoing `history` and `compiled` regex transforms in v2,
|
|
160
|
+
after schema characterization. Remove `display`/`both` as unsupported 0.4
|
|
161
|
+
configuration and remove destructive `finalize` transforms: they alter stored
|
|
162
|
+
assistant transcript after streaming and sit outside deterministic compilation.
|
|
163
|
+
|
|
164
|
+
Provide one explicit v1-to-v2 migration utility with dry-run default, per-file
|
|
165
|
+
diagnostics, no overwrite unless requested, backup/copy before replacement, and
|
|
166
|
+
no source deletion. It mechanically converts only documented safe fields and
|
|
167
|
+
emits error-level diagnostics for mutable variables, custom macros/slots,
|
|
168
|
+
removed regex effects, and unsupported template constructs. Users run the final
|
|
169
|
+
0.4 storage migration before the v2 utility; 0.5 does not retain the legacy
|
|
170
|
+
storage migration command.
|
|
171
|
+
|
|
172
|
+
### Alternatives
|
|
173
|
+
|
|
174
|
+
- Retain `finalize`: requires a separate persistent-transcript ownership and
|
|
175
|
+
previewability decision; defer rather than retain incidentally.
|
|
176
|
+
- Silently drop unsupported fields: reject; migration must make behavior loss
|
|
177
|
+
visible.
|
|
178
|
+
- Keep both legacy storage and v2 migration commands indefinitely: reject;
|
|
179
|
+
conflicts with the breaking-cleanup policy.
|
|
180
|
+
|
|
181
|
+
### Acceptance evidence
|
|
182
|
+
|
|
183
|
+
Fixture coverage proves dry runs do not write, conflicts/backups are explicit,
|
|
184
|
+
repeated runs are idempotent, and every removed field is reported. The final
|
|
185
|
+
0.4→0.5 user guide documents exact ordering and recovery.
|
|
186
|
+
|
|
187
|
+
## D7: physical package topology
|
|
188
|
+
|
|
189
|
+
### Candidate decision
|
|
190
|
+
|
|
191
|
+
Do not publish `pi-forge-core` in 0.5. Establish its boundaries as enforced
|
|
192
|
+
internal modules first. Publish only `@zihanw/pi-forge` and the optional
|
|
193
|
+
`pi-forge-subagents` package in Phase 5. The optional package uses documented
|
|
194
|
+
`@zihanw/pi-forge/subagent` host-port messages and Pi wildcard peers; it has no
|
|
195
|
+
dependency on core internals, web-editor modules, or a private copy of runtime
|
|
196
|
+
state. Extract core as a third package only after 0.5 if a named consumer proves
|
|
197
|
+
that package boundary necessary.
|
|
198
|
+
|
|
199
|
+
### Alternatives
|
|
200
|
+
|
|
201
|
+
- Introduce a workspace and three published packages immediately: reject; it
|
|
202
|
+
adds package/version/build complexity before interfaces are characterized.
|
|
203
|
+
- Let optional subagents import internal core modules: reject; it defeats the
|
|
204
|
+
host-port boundary.
|
|
205
|
+
|
|
206
|
+
### Acceptance evidence
|
|
207
|
+
|
|
208
|
+
Packed installs prove main pi-forge works with no subagent runtime/package, and
|
|
209
|
+
the optional package works only through the versioned host protocol.
|
|
210
|
+
|
|
211
|
+
## D8: final public surface
|
|
212
|
+
|
|
213
|
+
### Candidate decision
|
|
214
|
+
|
|
215
|
+
Use the public-surface register in the migration inventory as the Phase-6
|
|
216
|
+
allowlist. The root default extension remains stable. `/subagent` is the sole
|
|
217
|
+
versioned experimental host port. `src/*` aliases and root subagent re-exports
|
|
218
|
+
are removed. Resource/catalog/loader/profile helpers become internal unless the
|
|
219
|
+
consumer audit names a consumer and an intentional domain/service entry is
|
|
220
|
+
accepted. Macro/slot registration remains provisional pending the immutable
|
|
221
|
+
template/slot-port decision. Retain the two root documentation pointer files as
|
|
222
|
+
offline redirects in the 0.5 package unless the package documentation layout
|
|
223
|
+
otherwise provides a stable equivalent.
|
|
224
|
+
|
|
225
|
+
### Acceptance evidence
|
|
226
|
+
|
|
227
|
+
Update package exports, `files`, package checks, public-API tests, reference
|
|
228
|
+
docs, changelog, and migration guide in one Phase-6 change. Test rejection of
|
|
229
|
+
all removed subpaths from a packed install.
|
|
230
|
+
|
|
231
|
+
## Maintainer choices required
|
|
232
|
+
|
|
233
|
+
1. Accept, amend, or reject the host-RPC and `forge-v1` template spike
|
|
234
|
+
candidates.
|
|
235
|
+
2. Choose D3 dedicated subagent files versus a namespaced shared config file.
|
|
236
|
+
3. Choose D6 removal versus separately designed retention of `finalize` regex.
|
|
237
|
+
4. Accept/amend D1, D2, D4, D5, D7, and D8 before their affected phases.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# 0.5.0 full architecture proposal (archive)
|
|
2
|
+
|
|
3
|
+
Status: archived 2026-08-18 as the long-term target.
|
|
4
|
+
|
|
5
|
+
The active, executable 0.5.0 scope is now the [lean 0.5.0 architecture plan](../../architecture-0.5.md). The documents here were the original Phase-0 proposal and evidence base. They remain authoritative for the long-term target architecture, not for current 0.5.0 lane sequencing.
|
|
6
|
+
|
|
7
|
+
- [Full 0.5 architecture plan](architecture-0.5.md) — original six-phase target and release gates.
|
|
8
|
+
- [Migration inventory](0.5-inventory.md) — 0.4 surface characterization.
|
|
9
|
+
- [Public-consumer audit](0.5-consumer-audit.md) — known external consumer evidence.
|
|
10
|
+
- [Phase-0 decision drafts](0.5-phase0-decision-drafts.md) — original open decisions D1-D8.
|
|
11
|
+
- [Template-language spike](template-language-spike.md) — evidence behind `forge-v1`.
|
|
12
|
+
- [Pi host-discovery spike](host-discovery-spike.md) — evidence behind the event-bus host port.
|