dsh-ptc-plus 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +61 -123
- package/README.md +61 -123
- package/assets/dsh-ptc-plus-banner-en.webp +0 -0
- package/assets/dsh-ptc-plus-banner-zh.webp +0 -0
- package/assets/ptc-plus-repl-workspace-en.png +0 -0
- package/assets/ptc-plus-repl-workspace-zh.png +0 -0
- package/assets/ptc-plus-settings-en.png +0 -0
- package/assets/ptc-plus-settings-zh.png +0 -0
- package/client.cjs +42336 -0
- package/cordis.patch.yml +13 -2
- package/docs/README.md +7 -2
- package/docs/adr/0005-temporary-rejected-cell-edit-transport.md +31 -179
- package/docs/adr/0008-define-agent-operating-contract.md +5 -1
- package/docs/adr/0009-bound-expensive-acceptance-default.md +2 -2
- package/docs/adr/0016-archive-resolved-review-findings.md +1 -1
- package/docs/adr/0017-track-the-latest-dsh-public-surface.md +2 -2
- package/docs/adr/0019-plugin-settings-and-kill-switch.md +14 -3
- package/docs/adr/0020-optional-cordis-tools-in-ptc-mode.md +2 -2
- package/docs/adr/0022-stage-npm-releases-with-oidc.md +4 -2
- package/docs/adr/0023-global-user-bindings.md +3 -1
- package/docs/adr/0026-persist-the-delivery-verdict-against-the-verified-candidate.md +2 -0
- package/docs/adr/0028-attach-to-the-host-ptc-execution-seam.md +101 -35
- package/docs/adr/0030-serve-both-typert-codec-generations-from-one-codec.md +3 -3
- package/docs/adr/0031-close-semantic-obligations-by-owner.md +1 -1
- package/docs/adr/0032-own-session-log-facts-in-a-host-only-projection.md +27 -0
- package/docs/adr/0033-gate-client-visual-usability-in-a-browser.md +23 -0
- package/docs/adr/0034-keep-program-values-separate-from-output-projections.md +29 -0
- package/docs/adr/0035-run-coverage-only-before-a-new-release.md +27 -0
- package/docs/adr/0036-separate-focused-development-from-delivery-verification.md +29 -0
- package/docs/adr/0037-keep-tool-hover-previews-passive.md +52 -0
- package/docs/adr/0038-freeze-session-capability-plans.md +71 -0
- package/docs/adr/0039-verify-documentation-without-runtime-suites.md +29 -0
- package/docs/adr/0040-separate-capability-configurations-from-session-observations.md +39 -0
- package/docs/adr/0041-record-cell-execution-directories.md +65 -0
- package/docs/adr/0042-persist-provider-availability-and-handback.md +41 -0
- package/docs/adr/0043-compose-capability-and-context-policies.md +37 -0
- package/docs/adr/README.md +6 -0
- package/docs/architecture.md +25 -27
- package/docs/binding-review-placement-design.md +29 -21
- package/docs/capability-planning-components.md +93 -0
- package/docs/capability-projection.md +7 -0
- package/docs/client-ui.md +88 -29
- package/docs/client-visual-contract.md +65 -0
- package/docs/context-management.md +22 -0
- package/docs/context-optimization-plan.md +353 -0
- package/docs/context-public-interface-coverage.md +25 -0
- package/docs/durability-design.md +31 -14
- package/docs/evaluation.md +41 -6
- package/docs/evaluations/command-goat-deepseek-v4.1-flash-20261006.md +126 -0
- package/docs/evaluations/command-goat-deepseek-v4.1-flash.md +281 -0
- package/docs/installation.md +50 -8
- package/docs/program-data-plane.md +5 -3
- package/docs/publishing.md +5 -5
- package/docs/release-coverage.md +73 -0
- package/docs/release-notes.md +1 -1
- package/docs/review-procedure.md +56 -0
- package/docs/runtime-reference.md +48 -16
- package/docs/semantic-validation.md +14 -2
- package/docs/stateful-binding-updates-proposal.md +2 -2
- package/docs/user-bindings.en.md +2 -2
- package/docs/user-bindings.md +3 -3
- package/docs/value-wire.md +11 -1
- package/docs/verification-optimization-work.md +52 -15
- package/docs/verification.md +30 -86
- package/index.js +147 -23
- package/internal/binding-toggle-receipt.js +24 -0
- package/internal/capability-command-receipt.js +29 -0
- package/internal/capability-environment.js +1247 -0
- package/internal/capability-plan.js +285 -0
- package/internal/capability-policy.js +96 -0
- package/internal/capability-statistics-store.js +180 -0
- package/internal/capability-statistics.js +210 -0
- package/internal/compiler-platform.js +5 -3
- package/internal/compiler-service.js +2 -9
- package/internal/config-spec.js +79 -9
- package/internal/cordis-tools-owner.js +22 -19
- package/internal/direct-surface-owner.js +29 -29
- package/internal/dynamic-environment-runtime.js +9 -9
- package/internal/edit-transport-owner.js +183 -139
- package/internal/execution-provider-owner.js +160 -0
- package/internal/execution-seam-compat.js +76 -120
- package/internal/isolated-worker.js +12 -8
- package/internal/kernel-worker.js +104 -32
- package/internal/native-root-dynamic.js +12 -13
- package/internal/program-bindings.js +190 -0
- package/internal/recovery-tips.js +53 -23
- package/internal/rejected-cell-editor.js +8 -8
- package/internal/repl-observation-interest.js +11 -3
- package/internal/rpc-contract.js +1 -0
- package/internal/runtime-bridge-owner.js +351 -82
- package/internal/runtime-config.js +58 -0
- package/internal/runtime-contexts.js +85 -16
- package/internal/runtime-intrinsics.js +1 -0
- package/internal/runtime-messages.js +41 -0
- package/internal/sdk-projection.js +10 -82
- package/internal/session-cell-executor.js +42 -19
- package/internal/session-events.js +74 -4
- package/internal/session-journal-recovery.js +904 -184
- package/internal/session-journal-schema.js +6 -3
- package/internal/session-journal.js +31 -2
- package/internal/session-log-view.js +189 -43
- package/internal/session-runtime.js +175 -23
- package/internal/settings-compat.js +23 -6
- package/internal/stateful-module-compiler.js +3 -2
- package/internal/stateful-module-runtime.js +7 -3
- package/internal/stateful-root-runtime.js +9 -4
- package/internal/user-binding-authoring.js +2 -7
- package/internal/user-bindings-owner.js +47 -7
- package/internal/validated-parse-repair.js +1 -1
- package/internal/value-wire.js +68 -21
- package/internal/worker-cwd-virtualization.js +20 -18
- package/internal/worker-realm-surfaces.js +3 -3
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +55 -38
- package/src/client-authoring-view.js +286 -168
- package/src/client-binding-review.js +4 -1
- package/src/client-binding-toggle.js +18 -0
- package/src/client-capabilities-view.js +1341 -0
- package/src/client-capability-sort.js +29 -0
- package/src/client-code-editor.js +6 -0
- package/src/client-copy.js +881 -8
- package/src/client-feature-gates.js +15 -5
- package/src/client-host-compat.js +23 -2
- package/src/client-indicator-view.js +4 -6
- package/src/client-primitives.js +280 -0
- package/src/client-repl-view.js +23 -16
- package/src/client-settings-view.js +412 -69
- package/src/client-styles.js +193 -41
- package/src/client-tool-hover.js +185 -0
- package/src/client-tool-view.js +45 -11
- package/src/client-transport.js +44 -9
- package/src/client-workbench.js +9 -10
- package/src/client.js +148 -68
- package/assets/ptc-plus-bindings-en.png +0 -0
- package/assets/ptc-plus-bindings-zh.png +0 -0
- package/assets/ptc-plus-repair-en.png +0 -0
- package/assets/ptc-plus-repair-zh.png +0 -0
- package/client.js +0 -31857
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# 0040 Separate Capability Configurations From Session Observations
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted.
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
The settings must distinguish reusable user choices, actual statistical evidence and a session’s frozen effective environment. Configuration-only statistics and budgets cannot explain allocation, and a session-plan list alone cannot provide named portable configurations.
|
|
10
|
+
|
|
11
|
+
[ADR 0043](0043-compose-capability-and-context-policies.md) extends new environments with independent availability/disclosure rules, allocation inputs, collection, recovery and preview selections. The contracts below remain the historical v1/v2 recovery basis; freezing, authority and observation boundaries remain applicable.
|
|
12
|
+
|
|
13
|
+
## Decision
|
|
14
|
+
|
|
15
|
+
Named capability configurations are reusable settings, separate from a session's frozen effective plan and from actual usage evidence. The `capabilityProfiles` setting contains a `ptc-capability-profiles/v1` document with a `profiles` array. Each entry has a unique `id`, a unique trimmed `name` of at most 80 characters, and a `configuration` containing only management enablement, manual baseline/overrides, statistics settings and context budgets. The library contains at most 100 entries. The runtime configuration owner validates the format and settings. It contains no session identity, usage observations, program values, messages, provider choices or credentials.
|
|
16
|
+
|
|
17
|
+
Saving under an existing name explicitly replaces that configuration. Renaming and deleting change the library only. File import validates before writing, assigns fresh identities and disambiguates duplicate names; it never switches the active settings. Export includes the selected configuration or the whole library. Import files are limited to 2 MB. The Client serializes these documents; users do not enter JSON.
|
|
18
|
+
|
|
19
|
+
Switching a configuration applies its complete capability settings through one public DSH settings mutation. The library itself does not enter capability configuration revisions, system text or model context. Existing sessions retain their frozen plans until an explicit Host-owned refresh. Inspection returns the recorded source settings alongside the effective plan so users can name and save a copy; copying excludes session-only overrides, usage evidence and computation state. The copied source settings remain distinct from the effective settings derived with temporary choices. Settings containing invalid statistical parameters cannot become a reusable configuration until corrected, while runtime allocation retains its existing manual fallback.
|
|
20
|
+
|
|
21
|
+
The read-only `allocation` operation observes an explicitly selected active PTC session's current public capability inventory and workspace/global statistical coverage, then calls the existing pure capability planner with the settings being previewed. The observation context skips session preparation and binding loading. It does not freeze, publish or refresh a plan, register sample eligibility or use, load Skill bodies, execute capabilities or start model requests. A removed target or cancelled observation cannot publish a preview. Client replies are invalidated when target, settings, visibility or plugin state changes.
|
|
22
|
+
|
|
23
|
+
Statistics display actual uses and eligible session-family counts, with unavailable and incomplete evidence explicitly distinguished from zero use. Budget preview displays exact shared contract totals, allocation choices and reasons. Per-item body sizes exclude shared dependencies and rendered headings; the overall total includes them. Recovery and result-preview budgets cannot predict future content and are presented as limits, not fabricated forecasts.
|
|
24
|
+
|
|
25
|
+
## Alternatives considered
|
|
26
|
+
|
|
27
|
+
**Treat frozen session plans as reusable configurations.** A frozen plan includes inventory revisions and usage-derived choices that are specific to that session. Saving its source settings preserves user choices without presenting old evidence as current.
|
|
28
|
+
|
|
29
|
+
**Refresh or prepare a session to preview allocation.** Those operations publish model context and register eligibility. Read-only observation through the existing inventory and planner provides the preview without changing the session.
|
|
30
|
+
|
|
31
|
+
**Apply each configuration field separately.** Intermediate settings can form an unintended combination. One public settings mutation applies the complete configuration together.
|
|
32
|
+
|
|
33
|
+
## Consequences
|
|
34
|
+
|
|
35
|
+
Configuration libraries introduce a bounded validated settings format and explicit file import/export. Observation requires an active PTC session to supply its actual inventory and workspace; without one, the UI asks for a target rather than inventing statistics or allocation. Existing sessions still require explicit refresh after settings change.
|
|
36
|
+
|
|
37
|
+
## Evidence
|
|
38
|
+
|
|
39
|
+
The configuration, observation, Client lifecycle and browser contracts are exercised by `test/runtime-config.test.js`, `test/capability-environment.test.js`, `test/client-runtime.spec.js` and `scripts/client-fallback-smoke.mjs`. [ADR 0038](0038-freeze-session-capability-plans.md) continues to own freezing, statistics and explicit refresh semantics.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Record Cell Execution Directories
|
|
2
|
+
|
|
3
|
+
## Problem
|
|
4
|
+
|
|
5
|
+
DSH's working-directory service owns the current execution directory. The
|
|
6
|
+
immutable Session header still identifies the original project. A persistent
|
|
7
|
+
kernel that uses only that header sends new relative operations to an obsolete
|
|
8
|
+
directory. Resetting the kernel after a change loses continuous computation;
|
|
9
|
+
replaying all old cells from the new directory changes their source meaning.
|
|
10
|
+
|
|
11
|
+
## Decision
|
|
12
|
+
|
|
13
|
+
The resolved execution request supplies each live cell's directory. The runtime
|
|
14
|
+
validates it before preparation and retains the header only as the historical
|
|
15
|
+
fallback for hosts without a current-directory request. The kernel's queue
|
|
16
|
+
passes each directory to the compiler and worker without replacing the kernel,
|
|
17
|
+
bindings or module graph. New isolated computations inherit the requesting
|
|
18
|
+
cell's directory. The plugin never changes the Session header, write roots or
|
|
19
|
+
DSH directory state.
|
|
20
|
+
|
|
21
|
+
Journal v11 adds required `executionCwd`, an absolute string or `null`. New
|
|
22
|
+
cells record their resolved directory; `null` retains the historical
|
|
23
|
+
header/worker fallback when no directory was supplied. Closed v1–v10 inputs
|
|
24
|
+
migrate to `null`, preserving their original source base, language and transform.
|
|
25
|
+
Missing or malformed v11 directory evidence invalidates historical recovery
|
|
26
|
+
under the existing contraction rule. Replay selects each journal's recorded
|
|
27
|
+
directory, independently of the current request.
|
|
28
|
+
|
|
29
|
+
Stable Node wrappers read the worker execution owner's current directory at
|
|
30
|
+
the operation. Relative filesystem and path operations, `process.cwd()` and
|
|
31
|
+
new child processes follow it; explicit paths/options and already-created
|
|
32
|
+
processes retain their own semantics. An immutable `process.cwd` function can
|
|
33
|
+
report successive recorded directories without replacing its descriptor. A
|
|
34
|
+
confirmed in-cell `tools.working_directory` result is adopted for the remainder
|
|
35
|
+
of that cell, so the cell's relative operations and the Host tools, which
|
|
36
|
+
resolve at call time, share one directory; the journal records the call and its
|
|
37
|
+
result as the transition evidence while `executionCwd` remains the cell's
|
|
38
|
+
starting directory.
|
|
39
|
+
|
|
40
|
+
Each cell's static adapter, dynamic import environment, synthetic `import.meta`
|
|
41
|
+
and provided `require` capture that cell's module source base. Retained module
|
|
42
|
+
objects and escaped import/require functions keep their bases. Dynamic lexical
|
|
43
|
+
environments propagate their captured importer through activation, parameters,
|
|
44
|
+
eval, context and object scopes. Native module files continue resolving their
|
|
45
|
+
own imports from their actual URL. The shared public Node hook rewrites only
|
|
46
|
+
identified adapters, rather than treating every occurrence of a REPL parent
|
|
47
|
+
URL as the current cell.
|
|
48
|
+
|
|
49
|
+
Skill inventory reads the public working-directory service after Host prompt
|
|
50
|
+
assembly. Catalog observation and explicit refresh therefore see the current
|
|
51
|
+
directory. A directory change does not reallocate the frozen session plan.
|
|
52
|
+
Usage statistics retain the original project as their workspace scope.
|
|
53
|
+
|
|
54
|
+
## Evidence
|
|
55
|
+
|
|
56
|
+
`test/plugin-durability-recovery.test.js` compares two directories with same-name
|
|
57
|
+
files/modules, escaped imports, eval imports, saved require, new child
|
|
58
|
+
computations and continuous bindings; a separate cold replay uses a third
|
|
59
|
+
current directory. The same file verifies that one confirmed in-cell directory
|
|
60
|
+
change rebases relative reads while imports keep the starting directory, that a
|
|
61
|
+
failed change does not rebase, and that cold replay settles the recorded
|
|
62
|
+
transition identically. `test/session-journal.test.js` verifies closed predecessor
|
|
63
|
+
migration and malformed/missing v11 rejection. Capability tests distinguish
|
|
64
|
+
current Skill inventory, frozen plans, explicit refresh and project statistics.
|
|
65
|
+
These focused tests do not establish packed Host or Windows compatibility.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 0042 Persist Provider Availability And Handback
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted.
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
Historical capability plans, global API catalogs and computation journals can remain visible after PTC Plus releases its provider. Correct teardown of workers and registrations alone does not tell a later native request that these declarations are historical. A plugin that has already been destroyed cannot notify that request.
|
|
10
|
+
|
|
11
|
+
## Decision
|
|
12
|
+
|
|
13
|
+
Provider availability is a source-owned append-only fact, distinct from computation values, configuration receipts and capability-management enablement. A `plugin:ptc-plus` message with `form: runtime-availability` and `state: active | disabled | unloaded` has an exact validated body. Withdrawal makes earlier plugin continuous-computation instructions, capability plans, discovery and calling disclosures, and configured binding references inapplicable to the current runtime. It preserves tasks, Skill bodies, other producers, tool results and historical effects; it does not restore or undo a heap.
|
|
14
|
+
|
|
15
|
+
The passive runtime-message owner publishes disablement or resumed availability only through a witnessed, accepted, non-aborted Host step. Rejected, paused or cancelled proposals do not become delivery. Existing plugin declarations or a plugin journal namespace establish prior provider participation; journal presence does not prove any binding recoverable, initialized, live or known to the model. Repetition does not append a duplicate withdrawal. Re-enablement cannot restore a capability plan preceding the last validated withdrawal.
|
|
16
|
+
|
|
17
|
+
Complete plugin release first awaits the existing runtime controller's worker and registration cleanup, then persists unloaded availability while public session services remain available. Loaded sessions use their real Session append and Host flush. Unloaded stored sessions use the public persistence list and exclusive write handle, validate their surface with public pure interpreters, and append their own new withdrawal fact with append/flush/close. No Agent is created, model awakened, effect replayed, event sequence fabricated or second session coordinator introduced.
|
|
18
|
+
|
|
19
|
+
The lifecycle owner captures the public session, query and persistence services while they exist, rather than looking them up after removal. Loaded history uses a public immutable query cut. Offline handback is a new fact written by the releasing provider, not a Session resume: the exclusive public write handle supplies validated stored events and their next offset; `foldSurface` and `deriveEventMessage` apply installed first-party and live registered pure interpreters; `snapshotSessionEvent` validates the producer's own new `user/message` envelope; the extended surface is validated before `handle.append`, `flush` and `close`. It does not instantiate or publish an offline Session, invent a foreign resume marker, impersonate a user or command, or use deprecated synchronous readers. A loaded session whose query dependencies are already destroyed still reports that failure; retaining a service object does not recreate its dependencies.
|
|
20
|
+
|
|
21
|
+
Each session is independent. A writer conflict, damaged storage, flush refusal or unavailable public persistence ownership remains a real handback failure; cleanup continues for other sessions and aggregates these failures. The plugin never steals another process's writer. Successful in-memory append alone is not crash-durable evidence. Parent-service shutdown or external ownership can prevent persistence, so complete handback cannot be claimed in those cases. The failure must remain observable to the Host lifecycle owner; no promise is made that a destroyed dependency can still write.
|
|
22
|
+
|
|
23
|
+
User binding toggles publish a separate configuration receipt only after storage confirms the revision and entry. A public Conversation definition renders the source-validated receipt as its own visible node using current Client locale. The receipt proves saved enablement only; model catalog delivery still follows accepted-step publication and worker initialization still follows actual execution. It has no turn-trigger identity and does not wake a task. Capability command receipts similarly distinguish updated, pending first acceptance, unavailable, invalid usage, and globally saved but not applied states.
|
|
24
|
+
|
|
25
|
+
## Alternatives considered
|
|
26
|
+
|
|
27
|
+
**Erase historical messages or bindings on unload.** It destroys audit facts and implies rollback of effects. A new availability fact changes present applicability while retaining history.
|
|
28
|
+
|
|
29
|
+
**Notify from the next Agent after destruction.** The producer no longer exists; limiting handback to active Agents also misses loaded and offline sessions. Public Session and persistence owners can persist the transition before release without a task wakeup.
|
|
30
|
+
|
|
31
|
+
**Steal offline ownership or edit JSONL files.** It bypasses the Host's single-writer and validation contracts. Refusal is preserved and reported, not converted to successful handback.
|
|
32
|
+
|
|
33
|
+
**Use user/command/turn-trigger events for a binding toggle.** It confuses saved configuration with task initiation and may wake a model. A separately sourced fact and public renderer preserve both lifecycle and visibility.
|
|
34
|
+
|
|
35
|
+
## Consequences
|
|
36
|
+
|
|
37
|
+
Availability is reconstructable in native sessions after plugin removal without a plugin-specific projection interpreter. A declaration withdrawal cannot preserve the old continuous heap, prove source knowledge, provide missing Host tools or solve the independent top-level editor admission boundary. Persistence failures are explicit partial lifecycle outcomes.
|
|
38
|
+
|
|
39
|
+
## Evidence
|
|
40
|
+
|
|
41
|
+
`test/runtime-messages.test.js`, `test/capability-environment.test.js`, `test/user-bindings-owner.test.js` and `test/client-runtime.spec.js` exercise accepted publication, restoration, storage confirmation and locale rendering. Actual public JSONL persistence and full Loader removal require current packed-Host integration evidence; fixtures do not stand in for that boundary.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# 0043 Compose Capability and Context Policies
|
|
2
|
+
|
|
3
|
+
## Status
|
|
4
|
+
|
|
5
|
+
Accepted. Extends ADR 0038 and ADR 0040 for newly created environments.
|
|
6
|
+
|
|
7
|
+
## Context
|
|
8
|
+
|
|
9
|
+
A single full/on-demand/closed choice loses disclosure preferences when disabled, while a management switch also selects recovery and previews. Users need to compose those responsibilities without inheriting unrelated changes.
|
|
10
|
+
|
|
11
|
+
## Decision
|
|
12
|
+
|
|
13
|
+
`capabilityContextEnabled` is the persistent group selection. Turning it off pauses capability rules, statistics collection, explanation recovery and plugin previews together, without overwriting their independent saved choices, rules, budgets or retained observations. Turning it on restores that combination. The default is true for compatibility; it does not opt into any child feature. The group delegates Host capability and presentation behavior while paused and does not change computation, canonical values or DSH authority. `effectiveCapabilitySettings` owns the pure derivation from retained intent to applied settings; configuration libraries and frozen source copies retain the original inputs.
|
|
14
|
+
|
|
15
|
+
Capability availability and disclosure are separate inputs. A `ptc-capability-policy/v1` policy contains `defaults`, `categories`, `mcpServers`, `items` and `allocation`. Rules contain independently optional `availability` (`enabled` or `closed`) and `disclosure` (`host`, `full`, `on-demand` or `adaptive`). Defaults contain both dimensions. Category, proven MCP server and item rules override defaults in that order, independently for each dimension. An MCP server closure is an enclosing removal and wins over child enablement without deleting child preferences. Ambiguous server ownership cannot establish closure. Nonempty unresolved item identities remain removable configuration inputs; only actual managed inventory can give them effect.
|
|
16
|
+
|
|
17
|
+
`host` retains the existing PTC owner-provided explanation path for available members. `full` supplies complete contracts, `on-demand` retains bounded discovery, and `adaptive` permits allocation. Only adaptive choices consume the independently selected `allocation.baseline`, `allocation.statistics` and `allocation.budget` inputs. No allocation closes a capability. Explicit full contracts remain complete even when over budget. The policy applies only when capability management is selected; it never replaces DSH authority or the PTC code-only direct-tool projection.
|
|
18
|
+
|
|
19
|
+
Statistics collection uses `capabilityStatistics.enabled`; consuming those observations uses `allocation.statistics`. Either may be selected independently, and read-only observation requires neither. Collection without management derives eligibility from the actual live public inventory, including Host additions and withdrawals, never an empty disabled plan. Allocation may consume retained valid observations after collection stops. Host disclosure is recorded as such, not relabeled as on-demand. Existing family settlement, admission, revision and workspace evidence rules continue to apply.
|
|
20
|
+
|
|
21
|
+
`capabilityRecoveryEnabled` independently selects bounded recovery of recently used, expanded, currently valid API explanations after compaction. It does not control necessary navigation, contract withdrawal or environment change notices. It never restores Skill bodies or changes binding provenance. `modelPreviewEnabled` independently selects the plugin's result and log presentation budget. Unselected presentation delegates to the Host, preserving any existing Host policy, canonical values and execution outcomes.
|
|
22
|
+
|
|
23
|
+
Fresh settings retain host disclosure and do not select statistics allocation, explanation recovery or plugin previews. Migration of an older saved configuration preserves its former choices, including adaptive disclosure and management-coupled recovery/previews. Named configurations store all these reusable inputs atomically, never observations or session state.
|
|
24
|
+
|
|
25
|
+
New sessions record `ptc-capability-environment/v4` and `ptc-capability-plan/v3`, including the group selection, source settings, independent temporary overrides and effective derivation. Even a paused group records its frozen selection through the accepted plan message. Existing environment v1/v2/v3 and plan v1/v2 snapshots retain their original planner and rendering; v1/v2 environments retain their coupled behavior and v3 its independent selections. Current defaults never reinterpret them. Unknown or generation-inconsistent selections fail evidence validation. Saved settings do not change active sessions until explicit refresh. Dimension-specific session choices can remove only their saved dimension (`automatic`) or resume the frozen source (`inherit`); neither changes unrelated preferences. Existing combined commands retain their documented meaning.
|
|
26
|
+
|
|
27
|
+
## Alternatives considered
|
|
28
|
+
|
|
29
|
+
**Add more booleans around the combined choice.** Downstream switches cannot recover the disclosure preference that the combined representation discarded. Independent dimensions preserve that information at its owner.
|
|
30
|
+
|
|
31
|
+
**Split the feature into capability control and context optimization modes.** Each mode still bundles statistics, allocation, recovery and presentation. Structured responsibilities allow useful combinations without another mutually exclusive mode state.
|
|
32
|
+
|
|
33
|
+
**Reinterpret existing snapshots with current defaults.** That would change frozen environments and recovery semantics. A new recorded generation retains exact validation for historical plans.
|
|
34
|
+
|
|
35
|
+
## Consequences
|
|
36
|
+
|
|
37
|
+
The same rule resolver owns planner inputs, configuration inspection and all available-member consumers. Presentation may retain host contracts for one subset while using complete or on-demand contracts for others; shared owner instructions must remain wherever a retained member needs them. Operational inventory is required by selected management, collection or recovery, not by the presence of a policy generation. All unselected features and preview alone delegate the Host inventory lifecycle. In managed environments, Skill native eligibility remains recorded separately from effective invocation paths: removing the model loader preserves an independent user invocation. Resource contracts list only their available selected operations. Absence of every invocation path derives unavailability independently of management selection, without deleting preferences; it cannot establish statistics eligibility. Unselected policy closures never remove an actual Host path. Configuration controls expose dimensions and precedence rather than mutually exclusive feature modes. Combination support does not establish task quality or token savings.
|
package/docs/adr/README.md
CHANGED
|
@@ -16,3 +16,9 @@ This directory records stable design constraints for PTC Plus. An ADR states a d
|
|
|
16
16
|
- `## Consequences` — what the trade-off cost and bought; older entries may carry `## Verification` instead or omit it
|
|
17
17
|
- **Supersession.** When a later decision replaces an ADR, fold every unique rationale, alternative, and consequence into the current owner and repair inbound links before deleting the old file. Partial supersession keeps both files cross-linked. Git history is not the only copy of rationale.
|
|
18
18
|
- **Kept current.** When the code later moves a file, renames a surface, or changes a default, update the owning ADR in the same change (facts only, not the decision itself).
|
|
19
|
+
|
|
20
|
+
- [0041: Record Cell Execution Directories](0041-record-cell-execution-directories.md) — current execution, captured module sources and historical replay use distinct directory evidence.
|
|
21
|
+
|
|
22
|
+
- [0042: Persist Provider Availability And Handback](0042-persist-provider-availability-and-handback.md) — accepted-step availability, public persistent release and separately sourced configuration receipts.
|
|
23
|
+
|
|
24
|
+
- [0043: Compose Capability and Context Policies](0043-compose-capability-and-context-policies.md) — independent availability, disclosure, allocation, collection, recovery and presentation inputs with historical replay generations.
|
package/docs/architecture.md
CHANGED
|
@@ -16,33 +16,28 @@ PTC Plus 把 DSH PTC 模式的顶层 `run_code` 变成与 session 绑定的连
|
|
|
16
16
|
求值层由插件自有的 helper 进程承载:Host 只持有 `IsolatedWorker` transport,真实 `node:worker_threads` session worker 与其私有 `MessagePort` 都留在 helper 内,IPC 只传输 plain data。宿主回收卡住的计算时只强杀自己的 helper process,DSH 进程内没有需要终止的 session worker,因此不会触达已测得会落入 Node 24/26 cppgc teardown fault 的 in-host worker 强杀路径;`IsolatedOwner` 只在该实例的 real exit、output close 和 cleanup 都完成后释放。kernel、console、candidate 三个入口各自拥有 owner。helper 的 `init` 携带 fork 前 snapshot 的投影环境,user Worker 及其子进程保持原 env 契约,不会继承 `NODE_V8_COVERAGE` 等宿主 instrumentation;Electron Host 只在 helper fork 环境覆盖 `ELECTRON_RUN_AS_NODE=1`,该启动变量不进入 user Worker。inner Worker 的 compute budget 在每次请求提交时通过 helper 的 on-demand sample 取新鲜 `eventLoopUtilization` baseline,ready handshake 另有启动样本;采样失败按 worker-exit 有界失败且不派发 prepare/run。唯一例外由 [ADR 0024](adr/0024-repl-console-observation.md) 所有:同一 worker 已确认存在未完成的 observation 时,prepare 可先于预算启动,确认 observation 完成后才开始计时。
|
|
17
17
|
|
|
18
18
|
主入口接管模型直接发起的顶层 `run_code`,并通过 DSH tool registry 真实注册 `edit_run_code`。
|
|
19
|
-
使用 code-only direct-tool projection 的 PTC request
|
|
20
|
-
`tools.register()` 真实注册 edit transport
|
|
21
|
-
DSH
|
|
22
|
-
若模型误发 live schema 可证明的顶层 native call,stream canonicalizer
|
|
23
|
-
|
|
24
|
-
`edit_run_code`
|
|
25
|
-
|
|
26
|
-
`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
`run_code`。无目标或参数不合法时不执行,返回 `{ edited: false, reason }` 并保留原目标。
|
|
33
|
-
进程内 claim 区分 executing 与 settled:抛错、取消或缺少有效 PTC journal 的派生结果立即释放;已由 journal 证明进入 runtime 的派生执行继续占用旧 target,直到外层 result 的私有 metadata 通过最终 policy 并由 session log 投影为新 target。最终 result 丢失 metadata 时由 `tools/result` 释放。session log 投影在 edit call event 处记录 eligible target,只接受 target call sequence 匹配该快照且 journal 有效、非 noop 的派生源码,因此 live 与 cold recovery 从同一持久关系决定可编辑目标。
|
|
34
|
-
|
|
35
|
-
`internal/session-log-view.js` 单次前向扫描 session events,分别投影最新执行、可编辑目标、rewrite metadata、规范 journal 中的 Cordis transcript 计数和恢复 tip
|
|
36
|
-
所需事实。`edit_run_code` 不产生专用 runtime context:真实 call/result 已完整表达操作身份和结果,额外 contribution
|
|
19
|
+
使用 code-only direct-tool projection 的 PTC request 只暴露 `[run_code]`;插件用 agent scope 的
|
|
20
|
+
`tools.register()` 真实注册 edit transport,使 `tools.edit_run_code` 在首轮 program SDK 中可用。注册与 composition mode 记录都在所属 session、agent 或插件释放时撤销,native-mode 与无关 agent scope 不继承 `edit_run_code`。
|
|
21
|
+
DSH 的公开 presentation 为 `native` 或 `ptc`。agent composition owner、正式 `tools:ptc-only` section(兼容旧名 `tools:code-only`)与 live tool shape 决定是否接管 PTC;插件不选择额外 presentation mode。PTC 请求的 direct schema 只有 `run_code`,其他工具通过 program SDK 调用。model stream 将 session 与 call ID 绑定到请求策略;result settlement 和 session、agent 或插件释放分别撤销单次 call 与所属生命周期。
|
|
22
|
+
若模型误发 live schema 可证明的顶层 native call,stream canonicalizer 可将其规范为调用同一 member 的 `run_code`;未知、畸形或不一致输入原样透传。普通 JSON 参数保持原值,含 own `__proto__` 的参数使用安全字面量,超过 TypeScript parser 安全深度的参数使用浅层 `JSON.parse` 表达式。顶层 `run_code` 原样通过;`edit_run_code` 只允许正式 nested SDK 调用,不通过顶层 native-call 修复取得执行资格。
|
|
23
|
+
|
|
24
|
+
`edit_run_code` 在持久化 `tool/ptc-dispatch-start` 处捕获当前 open turn 最近的可编辑 cell,按 root、parent、sub-call identity、参数与 sequence 校验正式事件。调查工具不擦除目标,后来的 settlement 不追溯改变它。调用必须且只能提交 `edits` 或 `regex_edits` 之一,并可携带 `expected_target_call_seq`;目标前置条件不一致时不派生执行。`internal/rejected-cell-editor.js` 统一拥有 schema、匹配、JavaScript replacement 语义、预算和原子源码物化。
|
|
25
|
+
|
|
26
|
+
接受收据为 `{ accepted: true, scheduled: true, target_call_seq }`,拒绝为 `{ accepted: false, scheduled: false, reason }`。接受只表示待执行:外层 cell 的后续语句仍使用当前状态,保留其 canonical return 或 error。外层 worker 结束后、根结果结算前,runtime bridge 通过 DSH 公共 `tools.execute()` 执行完整修订源码,并通过调用开始前已安装的公开 `projectContent` 将派生 content、images 送入根 post-policy;`exec.deferContext` 与 `exec.concludeTurn` 转发 additionalContexts 和成功根结果的 concludesTurn。成功根结果保留 Host canonical 对象,避免重新投影丢失 journal;根 policy 仍可替换或阻断这些展示内容。 runtime bridge 保留原有 callback 与 property descriptor;安装失败时撤回已安装部分,卸载时只恢复自己仍拥有的 callback。普通外层计算失败不撤销已接受编辑;取消、lease 结束或 disposal 阻止未开始的派生执行。同一根 cell 至多接受一次编辑,派生执行不能重新取得根编辑资格。
|
|
27
|
+
|
|
28
|
+
assistant history 保留原始根 `run_code`,正式 nested events 保留 editor 的名称、delta 参数与收据。插件通过公开 `Session.append` 记录真实派生 `run_code` 的 start/settle,实际执行的 parent token 与事件 parent 都来自仍在运行的根 transport;公开 scoped `tools/ptc-dispatch-log` 使用真实根 execution 留存内容。根结果私有 `dshPtcPlusPostEdit` 记录完整派生源码、journal、目标、editor 的 `startSeq` 与实际执行的 `executionStartSeq`;不虚构 assistant call、父调用或结算。最终 metadata 丢失不能撤销已发生效果,只使未证明状态丧失恢复资格。恢复 owner 校验根 journal 的收据、editor 和派生执行的正式 dispatch pairs、canonical 结算事实、目标变换与根/目标双重模型可见来源,按实际 root 后 derived 顺序恢复状态;cold replay 返回 recorded binding 值,不重新派发 editor 或外部效果。成功修订成为下一编辑目标。历史顶层 editor metadata 继续由其原有 generation 校验。详见 [ADR 0005](adr/0005-temporary-rejected-cell-edit-transport.md)。
|
|
29
|
+
|
|
30
|
+
`internal/session-log-view.js` 通过公开 `sessionProjections` 注册 host-only 的 `ptcPlusSessionLog` 单元。同步单事件转移维护最新执行、可编辑目标、rewrite metadata、规范 journal 的 Cordis transcript 计数、已投递提示身份与 cooldown/escalation 事实,以及按公开 surface operation 排序的当前 runtime messages。pre-step 与 assembly 只读该单元,不重新读取或折叠历史;异步恢复通过 `sessionQuery.observeSession` 取得不可变观察切点:editor 在自身 start 切点捕获目标,真实派生执行另取切点并获得新 admission;各入口只消费自身选定的不可变切点。旧的 array-backed session 使用同一转移的批量折叠,不修改 Host 状态。详见 [ADR 0032](adr/0032-own-session-log-facts-in-a-host-only-projection.md)。
|
|
31
|
+
`edit_run_code` 不产生专用 runtime context:真实 call/result 已完整表达操作身份和结果,额外 contribution
|
|
37
32
|
会重复已有事实;此类信息不进入独立 PTC 消息。只有缺少有效 journal、无法确认完成状态的 rewrite feedback 才保留独立生命周期;已结算失败的恢复指引由当前结果表达;成功的透明改写不产生 runtime context。
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
执行接入由 `internal/execution-provider-owner.js` 经公开 Loader/Cordis 组合:保留原 row 的模块与配置,将原服务置于 named isolation,另注册插件自有 global provider。`internal/execution-seam-compat.js` 选择该服务并拥有 request/spec 边界;主插件卸载只释放自有 provider 的私有 execution callback,恢复原生委托与能力 getter,不写原实例的 `run` 或描述符。移除完整 bundle 时,Loader 生命周期先同步撤销插件注册,再让原 provider 回到 global slot。`presentationMeta` 仍由 runtime bridge 单独还原;它不属于 provider composition(见 [ADR 0028](adr/0028-attach-to-the-host-ptc-execution-seam.md))。旧 provider generation 不能复活已释放的 session 状态。
|
|
40
35
|
稳定 REPL 指引与执行共同从 `binding-update-policy.js` 取得语言代际。新代际说明 TypeScript、顶层 await/return、静态 import/export 与所选绑定更新策略;旧兼容态才按其独立开关说明支持的模块语法。显式结果使用 return,日志使用 console;原生表达式 completion 同样可以提供结果值。失败恢复先按状态分类:result 已证明解析或 preflight 未执行且提供符合任务意图的 validated repair 时,
|
|
41
|
-
|
|
36
|
+
优先在新 `run_code` cell 中使用带目标保护的 `tools.edit_run_code`,无需等待 recovery context;该验证只证明语法/preflight 接受。其他小型修正可用 edit 执行完整 cell;
|
|
42
37
|
已执行或可能产生外部 effect 的目标,则必须依据操作 owner 的 retry/idempotence 契约和执行事实判断重跑。短 `run_code` 可以复用仍存活的 binding,但缩短源码不能证明幂等。能力和命令执行依赖当前 request
|
|
43
38
|
与 execution world,模型必须先探查 live binding、实际 executable 和路径语义,不假设某个平台、shell 或 package runner。
|
|
44
39
|
|
|
45
|
-
live `PTC-C001` 若精确落在源码 EOF,独立的 bounded analyzer 只把追加由 `}`、`)`、`]` 组成、长度为一或二的 12 项候选源码分别送入该 cell 提交时的同一 preparation context。仅当唯一候选通过、无 binding collision,现有 exact editor 能从不超过固定预算的唯一尾部物化同一源码,并且 runtime 已取得该 rejected `run_code` 的持久 call sequence
|
|
40
|
+
live `PTC-C001` 若精确落在源码 EOF,独立的 bounded analyzer 只把追加由 `}`、`)`、`]` 组成、长度为一或二的 12 项候选源码分别送入该 cell 提交时的同一 preparation context。仅当唯一候选通过、无 binding collision,现有 exact editor 能从不超过固定预算的唯一尾部物化同一源码,并且 runtime 已取得该 rejected `run_code` 的持久 call sequence 时,诊断才输出一行供新 `run_code` cell 使用的 `await tools.edit_run_code({ edits: [...], expected_target_call_seq })`。edit transport 把该 sequence 与正式 nested start 捕获的目标比较,目标已变化时不编辑也不派生执行。这项 validated repair 优先于长度阈值,但只证明语法/preflight 接受;插件不自动 dispatch,也不改写原始 `run_code`。非 EOF、多候选、需要三个及以上闭合符、超预算、缺少目标身份或后续 preparation 拒绝均使用 length-adaptive help。
|
|
46
41
|
|
|
47
42
|
稳定指引保留这些跨任务不变量和失败恢复的优先动作。长 cell 失败的短提示直接作为当前 `PTC-X001` 的结构化 `help` 输出;重复绑定失败和当前 execution world 中由诊断确认的 executable、shell 或 path 错误仍由当前 session log 派生为以 `tools:ptc-plus-tip/<trigger>/<ordinal>` 标识的独立 notice,词法失败指向可见源码与初始化,worker-owned capability 失败才指向能力探查,平台错误则提示重新确认环境。投影合并规范 PTC notice 与历史 DSH system-prompt snapshot sections,同一已投递 identity 跨两种来源只计一次,正文不参与身份判断。
|
|
48
43
|
相同提示受 `tipCooldownMessages` 间隔约束,连续未解决时才升级为详细版本,成功 cell 会重置未解决计数;提示不会改变
|
|
@@ -108,17 +103,19 @@ Client 遇到冲突后重读 catalog、draft 和 review;只有权威空 draft
|
|
|
108
103
|
|
|
109
104
|
PTC 动态状态通过 DSH 公共 `agent/pre-step` 追加为 `source.kind: plugin:ptc-plus` 的独立 `user/message`。未知完成状态的 rewrite feedback 与 Cordis recovery 构成有界 `snapshot`;全局绑定 API 说明使用独立 `catalog`;恢复 tip 是以 trigger/ordinal 为 identity 的 `notice`。恢复快照只替代 PTC 旧状态,空快照撤销旧状态,不替代绑定目录、authoring task、Skill、tool result 或其他 producer。PTC 更新不重发其他 owner 文本,其他 owner 的 aggregate 更新也不重发未变 PTC 信息。`systemPrompt.context` 中的空 witness 受 `includeRuntimeContext` 与 scoped suppression 管理且不渲染 aggregate 文本;assembly 捕获精确请求事实,pre-step 委托宿主 waterfall 后只对匹配且未取消的 accepted step 提议消息。已提交记录与公共 ordered surface 共同决定去重和状态重申;缺少公共 surface 时不推断可见状态,不投递。raw history 只可用于 tip identity/cooldown,不能让隐藏 binding 变成模型知识。关闭 PTC 后仅保留撤销旧声明所需的被动 presentation cleanup,不安装 runtime 或读取 binding 存储。Cordis 恢复使用规范 journal 与当前 agent/enable generation;绑定目录只描述当前启用配置,不要求激活证明。目录和恢复快照分别去重与撤销,Host aggregate 的撤销不适用于目录;暂停只限制新投递。历史快照中的绑定段由一次恢复快照退役。此类状态不得进入 `PromptAssembly.sections`,也不得通过 tool/schema/order 变化传递。来源、边界与历史兼容由 [ADR 0010](adr/0010-session-log-derived-recovery-tips.md) 拥有。
|
|
110
105
|
|
|
111
|
-
所有模型可见输入都必须能从 session log
|
|
106
|
+
所有模型可见输入都必须能从 session log 重建。当前静态 system 由正式 `system/message` 与公共 ordered surface 保存,配置和完整有序 schema 由 `request/header` 保存,动态 context 由带来源的 `user/message` 保存;历史 `header.system` 只按其记录的旧 Session 格式解释。进程内临时状态不能直接成为未记录的模型输入。在同一插件版本与配置下,普通执行结果、可编辑目标、诊断和其他插件拥有的运行期变化都不得改变静态 system 或 header;`edit_run_code` 的身份与结果由真实 call/result 表达,不生成 edit feedback context。插件升级、显式配置变化、provider/model route 变化、真实 native capability schema 变化,以及 DSH 拥有的 history replacement 可以使缓存从首个变化 token 起失效。
|
|
112
107
|
|
|
113
108
|
全局绑定条目属于可变的用户计算输入;修改其提示词、接口、源码或启用集合通过上述追加通道同步,不能套用静态插件配置变化的例外来重写 header。配置说明可从已提交 PTC catalog 重建,且不为保留隐藏的 session-local 状态提供额外证明。
|
|
114
109
|
|
|
110
|
+
能力方案在首个请求前组装完成;会话尚无已提交任务历史时,经 `agent/pre-step` 将初始方案放在接受批次的任务文本之前,受保护 system head 仍由 Host 先提交。正文依次为有界的固定类别用途导航、显式完整契约、已选基线、其余统计选择的契约,各组按身份排序并去重共享依赖。自动选择改变不改导航;样本数和 digest 不渲染。相同方案的不同任务可共享整个能力说明前缀,统计改变成员时尽量共享变化组之前的文本。已有会话冻结启用与披露选择;宿主实际契约修订或撤下能力以 capability-contracts 追加说明,不重分配选择。显式刷新和恢复仍追加,不为提高缓存率重排历史。初始能力格式统一为 v1,恢复核验方案及正文。目录不复制单项完整描述,保持预算与缓存前缀两项约束。
|
|
111
|
+
|
|
115
112
|
缓存稳定性必须有 keyless contract test:跨每个相关生命周期状态序列化并比较完整 system text 与有序 tool schemas,同时断言 edit 不增加 runtime context。真实模型的 `cacheReadTokens` 只作为端到端补充;“不破坏缓存”表示插件保留已有可复用前缀,不承诺 provider 建立、保留或命中缓存。
|
|
116
113
|
|
|
117
114
|
## 能力表面
|
|
118
115
|
|
|
119
|
-
cell 直接使用 DSH 为当前 request 提供的 `tools
|
|
116
|
+
cell 直接使用 DSH 为当前 request 提供的 `tools.*`,仅按显式启用的冻结会话方案移除关闭成员,不翻译已提供的 program-call 参数或 canonical result。只有完全省略参数且 DSH 的 live object schema 验证 `{}` 合法时,worker 才在 encoding 前把 omission 规范为 `{}`;显式 `undefined`、需要输入的 member 与其他 namespace 不变,调用方携带的内部 metadata 不能扩大这项集合。模型 direct-call 边界与这个 data-plane contract 分离:声明的顶层 transport 只有 `run_code`,editor 经 `tools.edit_run_code` 调用;可证明的误发 native call 可先规范为 `run_code`,native member 随后在 cell 内 nested dispatch。所有 native member、`capabilities.*`、`repl.state` 和 `code.*` 共享 cell lease;cell 结束后,捕获的函数统一失效。调用时仍由 DSH 检查 scope、policy、取消和 scheduler。
|
|
120
117
|
|
|
121
|
-
`capabilities.tree/find/inspect` 是描述 API
|
|
118
|
+
`capabilities.tree/find/inspect/search` 是描述 API,不是反射调用入口。search 的 cell-local 派生索引返回完整匹配条目,计量完整 JSON 的 UTF-8 字节,延续游标绑定目录及 query,过长条目给出明确 inspect 指针。默认 SDK 展开这个导航器,Global User Bindings 开启时另声明稳定的 `code.submitBindingDraft`;`repl.state` 与 `code.run` 保持可调用,但其完整契约只在 explorer 中按需返回。explorer 合并 live tool schema 与插件自有 program-binding 描述;可证明的 metadata 包括名称、描述、输入/输出 schema、authority 和 replay。effect 与 result completeness 没有 owner 证据时保持 `unknown`。探索不会授予权限或触发额外模型调用。
|
|
122
119
|
|
|
123
120
|
当前公共扩展面没有跨 prompt assembly 与 cell dispatch 的冻结 view token。PTC Plus 使用同一 agent scope 分别读取 prompt 和 runtime view,并让实际 request binding 成为执行事实;能力在两阶段之间变化时,不伪造原子快照保证。
|
|
124
121
|
|
|
@@ -148,7 +145,8 @@ cell 的静态 import 与 remote re-export 产生有序 preload,Node 继续拥
|
|
|
148
145
|
|
|
149
146
|
```ts
|
|
150
147
|
{
|
|
151
|
-
version:
|
|
148
|
+
version: 11,
|
|
149
|
+
executionCwd: string | null,
|
|
152
150
|
languageSemantics: "legacy-v1" | "stateful-v1" | "protected-v1",
|
|
153
151
|
moduleTransform: "amaro@1.1.11" | "stateful-module-v1+amaro@1.1.11" |
|
|
154
152
|
"stateful-module-v2+amaro@1.1.11" | "protected-module-v1+amaro@1.1.11",
|
|
@@ -175,9 +173,9 @@ cell 的静态 import 与 remote re-export 产生有序 preload,Node 继续拥
|
|
|
175
173
|
}
|
|
176
174
|
```
|
|
177
175
|
|
|
178
|
-
`languageSemantics` 选择语言契约,`moduleTransform` 选择确切 parser、compiler 与 lowering generation;两者必须是允许的配对。v1–v8 固定迁移为 legacy transform,v9 按发布时映射恢复,其中 `stateful-v1` 使用 `stateful-module-v1`,不能按当前 transform 重解释。`bindingPolicy`、`rewritePolicy` 与 `moduleSemantics` 保留历史细分契约;新代际从统一策略派生它们,旧代际由冻结编译器消费。`userBindingsFingerprint` 以 `null` 证明不存在 Global User Binding 输入,或以 SHA-256 绑定并行私有快照;声明存在但快照缺失或不一致时,node 形成 unknown boundary。`userBindingsShadowPolicy` 固化该 cell 的 session-local 覆盖粒度,`userBindingNames` 以按名称排序的 `{name, state}` 记录结算时的 provider/local/absent/unknown 事实,因此 cold replay 按历史粒度重放覆盖关系,不从当前实现推断 v1-v7 cell 的整条 entry 语义;provider 事实必须对应并行快照的条目 ID,并覆盖该快照公开的每个名称,否则 node 形成 unknown boundary。`calls` 只保存 global、member、PTC Value Graph 编码的 args/result 或 error,以及 settlement 序号。cold replay 校验调用名称、参数、数量和提交顺序,并按 recorded settlement order 释放 recorded result;不会重新 dispatch program binding 或重做外部 effect。该规则同样适用于 native tools、owner-provided namespace 和 `code.run`,不按名称分支。Cordis 的进程内对象不会因此被宣称已恢复;presentation 可以从已验证 transcript 派生重新检查要求,但不能改变 replay。若基础设施终止时仍有未结算 binding,heap 回滚到 durable frontier,discarded journal 以最先观察到的 `global.member` 保留 possible-effect boundary。effect、completeness 和 source metadata 属于 capability explorer,不伪装成 journal 字段。
|
|
176
|
+
`executionCwd` 记录本 cell 的已解析当前目录;重放消费记录值,v1–v10 保留 header/worker 基准,不按当前目录重解释历史([ADR 0041](adr/0041-record-cell-execution-directories.md))。`languageSemantics` 选择语言契约,`moduleTransform` 选择确切 parser、compiler 与 lowering generation;两者必须是允许的配对。v1–v8 固定迁移为 legacy transform,v9 按发布时映射恢复,其中 `stateful-v1` 使用 `stateful-module-v1`,不能按当前 transform 重解释。`bindingPolicy`、`rewritePolicy` 与 `moduleSemantics` 保留历史细分契约;新代际从统一策略派生它们,旧代际由冻结编译器消费。`userBindingsFingerprint` 以 `null` 证明不存在 Global User Binding 输入,或以 SHA-256 绑定并行私有快照;声明存在但快照缺失或不一致时,node 形成 unknown boundary。`userBindingsShadowPolicy` 固化该 cell 的 session-local 覆盖粒度,`userBindingNames` 以按名称排序的 `{name, state}` 记录结算时的 provider/local/absent/unknown 事实,因此 cold replay 按历史粒度重放覆盖关系,不从当前实现推断 v1-v7 cell 的整条 entry 语义;provider 事实必须对应并行快照的条目 ID,并覆盖该快照公开的每个名称,否则 node 形成 unknown boundary。`calls` 只保存 global、member、PTC Value Graph 编码的 args/result 或 error,以及 settlement 序号。cold replay 校验调用名称、参数、数量和提交顺序,并按 recorded settlement order 释放 recorded result;不会重新 dispatch program binding 或重做外部 effect。该规则同样适用于 native tools、owner-provided namespace 和 `code.run`,不按名称分支。Cordis 的进程内对象不会因此被宣称已恢复;presentation 可以从已验证 transcript 派生重新检查要求,但不能改变 replay。若基础设施终止时仍有未结算 binding,heap 回滚到 durable frontier,discarded journal 以最先观察到的 `global.member` 保留 possible-effect boundary。effect、completeness 和 source metadata 属于 capability explorer,不伪装成 journal 字段。
|
|
179
177
|
|
|
180
|
-
journal 通过 `run_code.output.presentationMeta` 附着到最终 result
|
|
178
|
+
根 journal 通过 `run_code.output.presentationMeta` 附着到最终 result;受控派生执行在公开 Host 未调用 nested projector 时可采用保留 canonical value 身份的私有凭证([durability design](durability-design.md#两阶段确认)),再由 `tools/result` 做两阶段确认。live binding catalog 在 worker 结算时随实际状态更新,下一条排队 cell 使用这份目录准备;journal 确认只推进持久历史,迟到或逆序的确认不能覆盖较新的 live 目录,也不能恢复已重置的状态。缺失、损坏或被替换的 journal 形成 unknown/volatile 边界;未进入 runtime 的 call 由后续 `confirms` 以对应 `tool/call.seq` 证明为 no-op。volatile 源码保留在原 session log,但不参与 cold replay。
|
|
181
179
|
|
|
182
180
|
恢复从当前请求对应的 head 沿 parent 关系向更早状态收缩,而不是越过损坏记录继续假定原 heap 存在。候选 frontier 同时受两种证据约束:append-only session log 中的 journal 证明状态可重建;生成当前调用的 DSH ordered surface/derived request history 证明模型可以知道其精确 binding provenance。raw event 未删除不等于模型仍可见,Client 的 `dshPtcPlusBindings` inventory 也只是 UI presentation。只裁剪 tool result、仍把携带源码的 assistant call 留在模型 surface 中时不必删除对应状态;assistant provenance 被遮蔽且没有显式、有界、模型可见的结构化状态投影时,live worker 与 cold replay 都必须收缩。插件不从自然语言 compaction summary 推断 binding。
|
|
183
181
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Binding 草稿在当前输入框上方展示
|
|
2
2
|
|
|
3
|
-
状态:完整草稿由已发布的 `conversation.input.dock`
|
|
3
|
+
状态:完整草稿由已发布的 `conversation.input.dock` 承载;历史命令位置只保留请求和只读来源。面板由公开 dock 内的零高度锚点悬浮承载,放大使用公共 Modal,不读取宿主内部几何结构,验收以正式打包后的浏览器实际行为为准。
|
|
4
4
|
|
|
5
5
|
## 产品目标与分发边界
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ PTC Plus 必须独立安装到未经修改的官方 DSH,不能修改宿主源
|
|
|
25
25
|
原生回答尾部、文件产物与操作
|
|
26
26
|
──────────────────────────
|
|
27
27
|
当前输入区
|
|
28
|
-
PTC Plus
|
|
28
|
+
PTC Plus 零高度草稿锚点(预览向上悬浮,不占正文高度)
|
|
29
29
|
名称、用途、导出信息
|
|
30
30
|
完整源码与模型上下文(默认展开,内部可滚动)
|
|
31
31
|
保存为停用 / 保存并启用 / 丢弃
|
|
@@ -33,14 +33,16 @@ PTC Plus 必须独立安装到未经修改的官方 DSH,不能修改宿主源
|
|
|
33
33
|
用户输入框
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
插件以独立 id `ptc-plus-binding-review`
|
|
36
|
+
插件以独立 id `ptc-plus-binding-review` 注册,`order: -30` 将本贡献置于普通 dock 卡片之前。自有锚点留在公开 slot 中但高度为零,面板在 Portal 内从锚点向上 fixed 展开;展开或折叠不改变对话或输入框几何。其他贡献保持各自顺序与布局,预览可覆盖其上方的历史内容,但不向下覆盖普通 dock 卡片或输入框。插件在预览可见时逐帧读取自有锚点,只有几何变化时更新位置与高度预算;只读取 visualViewport 和自有节点,不探测普通 composer 的祖先或宿主滚动容器。CSS 有效预算容不下实际标题、操作行和最小正文时仅呈现标题及放大、关闭按钮;若连完整标题也放不下,则让出预览,保留输入区和历史请求的审阅入口;用户从入口打开时直接放大,关闭放大后焦点回到输入区入口。扩大视口后按原有展示选择恢复。
|
|
37
|
+
|
|
38
|
+
“放大查看绑定草稿”通过公共 Modal 或既有回退组件展示同一候选与动作。该模式仅是 review controller 的展示选择,不新增 RPC、写资格或候选来源。弹窗正文独立滚动,标题和底部动作保持可见;Escape、遮罩或缩小按钮恢复展开预览,已确认保存或丢弃则关闭全部当前展示。
|
|
37
39
|
|
|
38
40
|
该落点不参与 Chat 节点排序,不占用 `turnTail` 的 chain,也不需要调用原生 renderer 再拆解其结果。宿主继续拥有正文、原生尾部、文件产物、分支和滚动容器;插件拥有面板内部渲染与样式。不得用额外的虚假事件把 UI 布局写进 session log。
|
|
39
41
|
|
|
40
42
|
| 方案 | 适用性与本次选择 |
|
|
41
43
|
| --- | --- |
|
|
42
|
-
| `conversation.input.dock`
|
|
43
|
-
|
|
|
44
|
+
| `conversation.input.dock` 中的悬浮预览 | 已发布的 session list 提供会话生命周期和输入区锚点;零高度锚点消除展开对对话高度的影响,内部滚动保留完整内容。 |
|
|
45
|
+
| 公共 Modal 的 Portal | 放大审阅采用此路径;仅在当前输入入口可见时打开,宿主接管时隐藏,保留同一候选与展示选择。 |
|
|
44
46
|
| 替换公开 renderer,再组合公开组件 | 公共契约支持时可以使用;本需求无需接管原生回答渲染。没有公开的“下一个 renderer”入口时,不假定可以组合任意注册项。 |
|
|
45
47
|
| 独立 Conversation 节点 | 适合需要历史位置的业务内容;当前目标不需要,而且同轮尾部节点可能改变原生分支资格。 |
|
|
46
48
|
| 命令位置或原生操作行 | 前者位置过早,后者是紧凑操作区;不作为当前完整审阅的落点。 |
|
|
@@ -79,7 +81,7 @@ PTC Plus 必须独立安装到未经修改的官方 DSH,不能修改宿主源
|
|
|
79
81
|
| 没有可展示的当前候选或已确认回执 | dock 不占空间;历史请求及其已有候选仍可只读查看,不从历史挑一份升级为当前草稿。 |
|
|
80
82
|
| 编写中 | 原命令条目保留已有编写状态;dock 不重复展示一份编写请求,也不把上一份草稿冒充本次结果。 |
|
|
81
83
|
| 已接受,正在确认操作资格 | 新候选首次在 dock 展开,操作按钮暂不可用并说明正在载入。目录读取慢不应让已知源码消失;用户主动折叠或关闭后,读取完成不强制展开。 |
|
|
82
|
-
| 当前草稿可用 |
|
|
84
|
+
| 当前草稿可用 | 按用户选择保持展开、放大、折叠或关闭;展开时显示完整内容和模型上下文,保留保存为停用、保存并启用、丢弃及既有 revision 冲突处理。 |
|
|
83
85
|
| 保存或丢弃成功 | 确认精确候选的处理结果后自动关闭面板;历史保留精确候选和有证据的 action。保存不等于会话已激活。 |
|
|
84
86
|
| 编写失败或旧草稿恢复 | 原请求只显示上述证据规则支持的状态;缺少证据时显示编写结果未知。没有已接受候选就不产生完整 dock 卡片。Host 恢复旧草稿时沿用该候选的展示选择,不自行改变 fallback 规则。 |
|
|
85
87
|
| 资格撤销、Host 重启或只剩历史证据 | 对仍能证明属于当前显示内容的候选保留只读查看;撤下写操作。没有当前身份时不把历史重新挑成活动草稿。 |
|
|
@@ -87,7 +89,7 @@ PTC Plus 必须独立安装到未经修改的官方 DSH,不能修改宿主源
|
|
|
87
89
|
| 切换会话、断线重连、分支或 seed | 按新会话 projection 重建;加载期间禁止沿用旧会话内容和写权限。历史可见性与当前资格分别判断。 |
|
|
88
90
|
| 禁用功能、释放 slot 或卸载插件 | 释放本功能拥有的订阅、计时器和面板;不自动保存、丢弃或执行候选。 |
|
|
89
91
|
|
|
90
|
-
同一会话只保留一个当前完整审阅 controller,按会话、请求、版本和 locator 隔离异步读取与动作。`conversation.chat.commandview` 的 `binding` key 继续渲染原有编写请求,不能因 dock 已注册、已出现或被关闭而返回空内容。保留 `BindingCommandCard`
|
|
92
|
+
同一会话只保留一个当前完整审阅 controller,按会话、请求、版本和 locator 隔离异步读取与动作。`conversation.chat.commandview` 的 `binding` key 继续渲染原有编写请求,不能因 dock 已注册、已出现或被关闭而返回空内容。保留 `BindingCommandCard` 的请求外观和状态区,只移走候选详细内容及写操作。所需展示能力可用且该请求精确对应尚未处理的当前候选时,必须提供“打开草稿”入口,直接进入同一候选的放大审阅,不重新执行 `/binding`;隐藏编写按钮的设置不影响该入口。历史主动查看仍可展开只读源码,但接受候选不得自动展开历史详情,也不能在历史中恢复保存或丢弃按钮。
|
|
91
93
|
|
|
92
94
|
现有页头 popover 的候选展示与保存/丢弃入口也应收拢:保留状态与管理入口,不再创建第二套当前草稿写入流程。历史只读内容可以复用展示组件,但不能恢复控制器或写权限。
|
|
93
95
|
|
|
@@ -95,49 +97,51 @@ PTC Plus 必须独立安装到未经修改的官方 DSH,不能修改宿主源
|
|
|
95
97
|
|
|
96
98
|
写操作仍使用 `save-draft` / `discard-draft`,传递现有 capability、version 及适用的 expected revision。请求切换、组件卸载或资格变动后的迟到响应不能恢复旧按钮;一次失败读取不证明候选已被撤销。待决写入按精确候选隔离:同一候选不重复提交,接受新候选后可独立读取资格和操作,旧响应不能阻塞新候选或清除其 busy 状态。已有必要的资格刷新可以复用,但不能为确定位置或等待回答结束新增轮询、事件订阅或第二套状态机。
|
|
97
99
|
|
|
98
|
-
##
|
|
100
|
+
## 折叠、展开、放大、关闭与重新打开
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
预览标题栏由折叠/展开按钮、独立放大按钮和独立关闭按钮组成。标题、状态与箭头属于同一个原生折叠/展开按钮,Enter 和 Space 使用原生按钮语义;放大和关闭动作不属于该切换区域,两个操作间距为 12px。放大窗口保留独立的缩小与关闭按钮:缩小恢复预览,关闭隐藏整个草稿面板。展开时箭头朝下表示收起,折叠时朝上表示展开,状态与 `aria-expanded` 一致,并遵循减少动画的系统偏好。完整内容默认展开不等于禁止用户收起。
|
|
101
103
|
|
|
102
104
|
| 用户操作 | 展示结果与草稿状态 |
|
|
103
105
|
| --- | --- |
|
|
104
|
-
| 折叠 |
|
|
106
|
+
| 折叠 | 悬浮预览保留名称、状态、展开、放大和关闭按钮,收起正文及保存/丢弃操作;不改变候选或编写事务。 |
|
|
105
107
|
| 展开 | 未处理候选在原 dock 位置恢复完整内容;已处理候选仅从历史请求查看。写操作仍以当前 Host 证据为准。 |
|
|
108
|
+
| 放大 | 公共 Modal 或既有回退组件显示同一候选;标题和操作保持可见,正文独立滚动。Escape、遮罩或缩小按钮明确恢复展开预览;预览无法完整显示时将焦点返回自有输入区入口。 |
|
|
106
109
|
| 关闭 | 隐藏整个 dock 面板,不保存、不丢弃、不取消编写,也不删除历史请求。 |
|
|
107
|
-
| 重新打开 |
|
|
110
|
+
| 重新打开 | 输入框星光按钮的草稿菜单或当前历史请求的“打开草稿”直接进入同一当前候选的放大审阅;不依赖隐藏期间缓存的预览几何,不重新发命令、生成候选或创建第二个操作 controller。 |
|
|
108
111
|
| 丢弃草稿 | 仅明确点击“丢弃”才调用既有 Host RPC;它与关闭面板是不同操作。 |
|
|
109
112
|
|
|
110
|
-
公开 `conversation.input.left` 只注册一个星光图标,统一插件设置快捷访问、全局绑定管理、编写与当前草稿访问。图标在悬浮或聚焦时以插件署名提示说明来源与用途,有未处理候选时改为提示草稿状态。首条消息前即可通过悬停、点击或方向键打开官方 `Menu
|
|
113
|
+
公开 `conversation.input.left` 只注册一个星光图标,统一插件设置快捷访问、全局绑定管理、编写与当前草稿访问。图标在悬浮或聚焦时以插件署名提示说明来源与用途,有未处理候选时改为提示草稿状态。首条消息前即可通过悬停、点击或方向键打开官方 `Menu`;设置条目直接打开复用完整设置表单的应用内窗口,悬浮提示保留宿主原生设置路径;全局绑定展示名称、用途及启用状态,点击条目切换对所有会话生效的启用配置,并可打开既有完整工作台。有未处理候选时显示数量角标,菜单中单独分组,按名称与状态选择候选后直接放大审阅。菜单中的“编写新绑定”沿用既有命令可用性与输入保护;“修改绑定”是同一个 `Menu` 的第二个步骤,列出已有全局条目,选择后以相同保护预填 `/binding edit <id> `。当前 Host 每会话只保留一份当前草稿,因此角标为 `1`,不把历史候选计为待处理草稿。草稿访问不依赖命令服务;隐藏编写快捷入口时保留已有草稿的星光图标,但不显示全局目录、管理与新建操作。插件与全局绑定功能开关仍统一控制整个入口。
|
|
111
114
|
|
|
112
|
-
|
|
115
|
+
当前宿主菜单使用公共 Portal 和 `getAnchorRect`,以触发按钮自身为锚点定位,按按钮上沿之上的实际可用空间限制插件内容节点的高度;插件通过公开 `Menu.children` 将绑定列表放入可收缩的独立滚动区,新建、修改、管理与设置操作留在不收缩的固定底栏;修改步骤的“返回”也放在底栏,不向宿主菜单节点写入样式。启用、停用分组显示数量,启用项优先,停用项每次打开菜单时默认折叠且隐藏行不渲染。短视口隐藏编写区的文字标题,保留可访问名称和全部按钮。悬停停留 150ms 的意图延迟后才打开菜单,指针扫过输入区不弹出菜单;点击与方向键路径不受延迟影响。菜单由外部点击或 Escape 关闭。悬停打开的菜单在指针离开触发器与列表 200ms 后关闭,重新进入列表或触发器即取消;该宽限覆盖指针短暂离开整个菜单的瞬间,因此越过输入区选择条目仍然可行。点击打开的菜单保持到显式关闭。点击与方向键打开时聚焦首个可用操作,Tab 可到达新建、修改和管理操作;进入“修改绑定”步骤后焦点移到第一个条目。候选变化、会话切换、功能关闭、卸载或普通输入区被接管时关闭菜单;普通刷新不关闭菜单。菜单选择必须向同一 review controller 传递精确候选,不能把旧项点击重定向到新候选。星光菜单和原请求的手动草稿入口直接放大审阅,避免依赖预览关闭期间的旧几何事实;返回预览明确选择 `expanded`,不会重新打开弹窗。原请求条目中的入口也只能打开其精确对应的当前候选;旧请求只允许查看自己的只读历史。展示能力暂不可用时,不提供实际无法打开面板的操作。
|
|
113
116
|
|
|
114
|
-
全局目录由现有 `list` Remote
|
|
117
|
+
全局目录由现有 `list` Remote 按菜单打开动作读取,不轮询;读取在后台进行,期间菜单沿用上一次已确认的目录并保持条目可操作。显式“重新加载”调用 `reload` 重新读取存储文件并清除已修复的读取错误。启停沿用 `enable`/`disable` 与 `expectedRevision`。catalog source 串行化写入并丢弃重复请求,写入期间行保持可用,关闭菜单不取消已发出的操作。启停后条目归入对应分组;菜单仍持有焦点时跟随原条目,原条目进入折叠停用组时回到组按钮。焦点已移出或菜单已关闭时不抢焦点。焦点资格由当前菜单的实际焦点事件拥有,不能沿用待决操作发起时的旧快照;待决写入期间重开菜单后取得的新焦点仍可恢复。打开、步骤切换和归组恢复共用自有列表内的显示操作:适合滚动区的目标靠近最近边缘显示,短窗口下更高的目标居中,只调整自有目录的 `scrollTop`,不滚动底栏或宿主对话。冲突或失败后撤下过期目录,用户重新读取后再决定是否重试,不自动重发写入。重连和组件释放使旧响应失效;菜单读取、显示和启停配置不执行绑定源码。菜单明确区分全局启用配置与待处理草稿,角标只统计草稿。
|
|
115
118
|
|
|
116
|
-
展示选择以 `(sessionId, requestId, candidateVersion)`
|
|
119
|
+
展示选择以 `(sessionId, requestId, candidateVersion)` 归属,包含 `expanded`、`enlarged`、`collapsed`、`hidden` 四种本地状态。当前 Client 内切换会话再返回、RPC 刷新、重连、普通消息追加以及审批临时接管,不重置同一候选的选择;真正接受的新候选默认展开,并从该候选的内容顶部开始阅读;同一候选的普通刷新保留滚动位置。刷新页面或重新加载插件后按当前有效候选恢复默认展开,不要求把展示偏好写入持久存储。共享此选择只协调插件视图,不承载 locator 或 Host 事务资格,也不增加 session log、模型消息或管理 RPC。
|
|
117
120
|
|
|
118
121
|
显隐选择不影响业务操作;精确候选一旦确认保存或丢弃成功,当前面板自动关闭。失败或结果待确认时保留用户的显隐选择:
|
|
119
122
|
|
|
120
123
|
| 结算时的展示选择 | 保存或丢弃已确认成功 | 写入失败或结果待确认 |
|
|
121
124
|
| --- | --- | --- |
|
|
122
125
|
| `expanded` | 自动关闭;回执与精确源码从原请求只读查看。 | 保留完整面板并展示错误或待确认状态;仅在重新证明可写后允许手动重试。 |
|
|
126
|
+
| `enlarged` | 释放弹窗;回执与精确源码从原请求只读查看。 | 保留放大窗口,错误和重试入口随正文滚动;仅在重新证明可写后允许手动重试。 |
|
|
123
127
|
| `collapsed` | 自动关闭;原请求显示处理结果。 | 保持折叠,标题提示有错误或结果待确认,允许用户展开查看。 |
|
|
124
128
|
| `hidden` | 保持关闭,不弹回执;原请求展示有证据的处理结果。 | 保持关闭,保留就近重新打开入口并提示有待查看状态,不自动展开或重试。 |
|
|
125
129
|
|
|
126
130
|
关闭或折叠待决操作中的面板不取消已发出的保存/丢弃 RPC;操作结算仍由同一 controller 接收。未确认处理结果时保留当前候选的访问入口,但入口不证明可以再次写入;一次网络错误不能触发重新提交。已确认保存或丢弃后移除两个当前草稿打开入口,结果和精确候选继续从原历史请求只读查看。确认结果统一由当前 controller 收敛:保存响应、精确 review RPC 或 projection 回执均关闭匹配候选,普通刷新不能重新打开;旧候选的迟到结果不能关闭新草稿。locator 撤销本身不证明处理成功。
|
|
127
131
|
|
|
128
|
-
|
|
132
|
+
用户关闭时,焦点移到就近且可见的星光按钮,聚焦本身不弹出菜单;按钮缺席时使用仍可见的插件自有入口。当前公开契约没有 composer 焦点接口,焦点恢复只操作这些自有返回目标;入口不可用时不查找宿主编辑器。成功后自动关闭仅在面板原本持有焦点时恢复焦点,不能打断用户在其他区域的操作。异步成功移除当前聚焦的打开入口时也应保持合理焦点,不能将其留在已移除节点;宿主接管时不从审批界面抢焦点。折叠按钮提供 `aria-expanded`,被隐藏的内容不得继续接受键盘焦点。
|
|
129
133
|
|
|
130
134
|
## 输入区接管与布局边界
|
|
131
135
|
|
|
132
136
|
官方普通 composer 是 `conversation.composer` chain 的 fallback。当前实现使用 `overlay: true`:其他 contribution 被选中时,fallback 保持挂载但被 `display:none` 隐藏,因此 input dock 也会隐藏。**注册成功不等于任何时候都可见;隐藏也不等于已卸载。**
|
|
133
137
|
|
|
134
|
-
|
|
138
|
+
审批或其他宿主交互接管输入区时,草稿区和重新打开入口随普通输入框一起暂时让位。放大弹窗由输入入口的自有 IntersectionObserver 可见性证明控制 open,入口不可见时释放 Portal 展示,但保留放大选择;不会把保存按钮强行叠到审批上。PTC Plus 的 REPL 视图接管 composer 时也按此规则隐藏;回到普通输入区后恢复同一份有效草稿及其原有展开、放大、折叠或关闭选择。重建时读取 projection 和 RPC,不依靠隐藏 DOM 保留权限。长驻 controller 必须能处理隐藏期间的撤销;用于刷新资格的任务仍受功能和会话生命周期约束,不能只依赖 unmount 清理。
|
|
135
139
|
|
|
136
140
|
普通对话中的正文继续流式输出、产生工具结果或开始下一轮,不是隐藏卡片的理由。所需边界是“普通输入区是否被宿主接管”,不能把 `input` 的任意 busy 状态当作隐藏条件,也不要求用户等待真实轮次结束。
|
|
137
141
|
|
|
138
|
-
|
|
142
|
+
面板采用不透明主题底色、细边框与阴影,明确表达临时浮层;插件拥有的标题、滚动正文和操作区以分隔线区分。名称只在标题出现,正文保留导出信息、用途、完整源码及模型上下文;丢弃与保存动作分置两侧,窄屏允许换行。预览以 dock 的插件自有零高度锚点为基准,宽度不超过 `44rem`;普通宽度两侧留 `16px`,窄屏两侧留 `8px`。预览通过 Portal 挂到 `document.body`,使用自有锚点与 visual viewport 的坐标定位;不读取或修改宿主祖先。
|
|
139
143
|
|
|
140
|
-
|
|
144
|
+
长内容必须保留完整文本并在内部滚动,不能以截断源码换取高度。预览以 `min(440px, 45dvh, 锚点上方可用高度)` 为上限;正文伸缩,保留至少 `40px` 的滚动窗口并以 `20rem` 为上限。CSS 拥有有效高度预算,以实际标题及面板边框判定预览是否可展示,不能为保留标题向下跨越锚点;正文最小高度计入分隔边框,保证至少 40px 的可滚动内容高度。若预算容不下标题、最小正文和实际操作行,预览只显示标题及放大、关闭入口,隐藏内容不可聚焦。放大弹窗使用独立的大尺寸预算,不继承预览和 `20rem` 限制;标题、操作行固定,完整源码、上下文及错误消息在正文内滚动。短视口使用更小外部留白,操作按钮按实际宽度换行。展开与折叠只改变零高度锚点上的插件浮层,不为定位读取宿主祖先、滚动容器或私有 CSS。隐藏、处理成功和卸载释放插件自己的交互状态,不持续滚动正文。浏览器验收同时检查实际点击命中、小视口下输入框与其他 dock 的可达性,不能仅凭注册成功或静态截图证明可用。
|
|
141
145
|
|
|
142
146
|
源码和模型上下文默认展开。历史详情和 dock 共用只读模型上下文区,以“接口声明”状态标签说明是否向模型提供,并单独呈现完整提示词或空状态;不使用禁用的表单控件表示配置。当前卡片不采用 hover 才显现的布局,不自动抢焦点或持续调用 `scrollIntoView`。键盘可进入内容滚动区和所有动作,窄屏操作行允许换行,动态视口下仍能访问输入框与审批。共享 list 的顺序只管理本插件贡献,不重排其他插件。
|
|
143
147
|
|
|
@@ -164,9 +168,9 @@ slot 的迟到、释放、再次声明和功能开关必须测试。缺少所需
|
|
|
164
168
|
| --- | --- |
|
|
165
169
|
| 官方安装 | 正式 tarball 安装成功,Host 源码和安装文件不变,实际加载最终插件 bundle。测试 fixture 自行声明 slot 不能替代此项。 |
|
|
166
170
|
| 请求与位置 | `/binding new`、`edit` 发出时保留历史中原有的绑定编写请求样式;接受后只更新请求状态,完整详情和写操作首次在 dock 展开,原条目不消失也不变成完整操作卡片。 |
|
|
167
|
-
| 展示控制 | 点击折叠态的标题文字即可展开,Enter/Space
|
|
171
|
+
| 展示控制 | 点击折叠态的标题文字即可展开,Enter/Space 同样可用,箭头随状态变化;展开/折叠不改变锚点、composer 和对话滚动范围;放大后正文具有更大阅读高度、独立滚动和固定动作,缩小返回预览,独立关闭按钮隐藏面板;浏览器验收比较完整 composer 几何与对话高度,并确认输入框、其他 dock 和面板操作可达。正文滚动范围继续由宿主布局决定。关闭仅隐藏,输入框旁与当前请求都能重新打开;同一候选的 RPC 更新、重连、普通消息和审批接管不覆盖用户选择,新候选首次展开。 |
|
|
168
172
|
| 内容与操作 | 精确源码和模型上下文默认可读;保存为停用、保存并启用、丢弃、busy、冲突、失败及回执正确。 |
|
|
169
|
-
| 结算与显隐 |
|
|
173
|
+
| 结算与显隐 | 保存或丢弃过程中分别保持展开、放大、折叠和关闭,验证成功、失败及结果待确认组合。已确认成功自动关闭面板并释放弹窗;已处理后的两个当前入口移除,回执与源码从原请求只读访问。 |
|
|
170
174
|
| 请求状态证据 | A 已有草稿,B 命令成功准入后未接受候选,projection 回到 A;B 在重新挂载、分页和重连后显示准入成功及编写结果未知,不能冒用 A 的 ready 或推断失败。命令处理错误、匹配 projection 的 failed、接受及 action 各自只归到对应请求。 |
|
|
171
175
|
| 候选与异步 | 新请求、旧请求恢复、跨会话、迟到 RPC、断线、重启、分支和 seed 不串候选,不以历史或旧 locator 恢复写权限。 |
|
|
172
176
|
| 唯一控制器 | 命令处和页头不再同时出现另一套当前保存控件;折叠或关闭期间的写操作不会丢失结算或重复提交。主动展开历史仅只读,分页不重新挂载活动控制器。 |
|
|
@@ -178,6 +182,10 @@ slot 的迟到、释放、再次声明和功能开关必须测试。缺少所需
|
|
|
178
182
|
|
|
179
183
|
按项目 ledger 流程记录实施发现,按预先声明的独立 review lanes 取得各 lane 的有效 verdict,最终在稳定树上依次运行 `npm run check`、用 `npm run review:finalize` 记录 composite verdict,再运行 `git diff --check HEAD --`。独立审查、确定性测试、实际 UI 验收是不同证据;不能把其中任一项替代其余。提交与发布仍遵循用户授权及独立审查条件。
|
|
180
184
|
|
|
185
|
+
悬浮预览可能随多行输入或其他 dock 而被宿主可视区域裁剪。预览只读取自有零高度锚点与 visualViewport,定位独立 Portal 并收紧自有 `max-block-size`,不遍历或读取宿主祖先来推算剩余空间。
|
|
186
|
+
预览关闭、放大、输入入口不可见或卸载时释放动画帧跟踪。
|
|
187
|
+
放大弹窗不沿用预览的尺寸预算,使用 Modal 的视口限额和内部 flex 正文。这种自有尺寸治理不声明可以重新布局其他贡献,也不取得宿主滚动权限。
|
|
188
|
+
|
|
181
189
|
## 公共契约与历史证据
|
|
182
190
|
|
|
183
191
|
已核对官方源码中的 slot 声明、原生根布局和贡献实例,以及已安装官方包的类型声明与实际 Client bundle 中的 dock 渲染。它们证明接口存在及设计落点可用,尚不证明 PTC Plus 面板已实现或完成浏览器验收。
|