@amaster.ai/employee-runtime-connector 0.1.1-beta.3 → 0.1.1-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ For production images, install an exact version and invoke the package bin:
13
13
  ```sh
14
14
  npm install --omit=dev --prefix /opt/pi-cli-runtime @amaster.ai/employee-runtime-connector@0.1.0
15
15
  /opt/pi-cli-runtime/node_modules/.bin/amaster-runtime setup https://employee.example.com \
16
- --capabilities remote_registration,heartbeat,executor_discovery,workspace_binding,run_wakeup,model_call,run_cancel,run_terminate,logs_cost_workspace_status
16
+ --capabilities remote_registration,heartbeat,executor_discovery,workspace_binding,run_wakeup,model_call,model_call_output_contract_v1,run_cancel,run_terminate,logs_cost_workspace_status
17
17
  /opt/pi-cli-runtime/node_modules/.bin/amaster-runtime daemon start --foreground
18
18
  ```
19
19
 
@@ -32,6 +32,47 @@ The source of truth lives under this package's `src/` directory. The package bui
32
32
 
33
33
  Runtime code belongs in the container image. Persist only connector state, the result outbox, and workspaces under the configured state directory.
34
34
 
35
+ ## Contracted Pi model calls
36
+
37
+ Pi `model_call` commands with `model_call_output_contract_v1` keep provider and
38
+ model selection paired with the output ceiling. Command target fields have the
39
+ highest precedence, followed by `AMASTER_PI_PROVIDER` / `AMASTER_PI_MODEL`, then
40
+ the Pi profile's `defaultProvider` / `defaultModel`. Each selected precedence
41
+ layer must be a complete provider/model pair: a partial command or runtime
42
+ override fails closed instead of silently falling through to a lower-precedence
43
+ default. The daemon copies only the normalized default pair into the isolated
44
+ one-shot profile, validates that the resolved model exists, applies
45
+ `maxOutputTokens` to that exact model, and records the resolved target and source
46
+ in command-result diagnostics. Missing or unknown targets also fail closed
47
+ before Pi is spawned.
48
+
49
+ ## Pi tool-argument transport guard
50
+
51
+ `AMASTER_PI_TOOL_ARGUMENT_GUARD_MODE` defaults to `shadow`; supported values are
52
+ `off`, `shadow`, and `enforce`. Shadow records metadata-only matches while the
53
+ single-incident thresholds are calibrated. Promote deliberately to `enforce`
54
+ after reviewing near misses and false positives; use `off` as the emergency
55
+ rollback. The enforce signature
56
+ requires at least 8 MiB transported, at most 512 KiB materialized, and at least
57
+ 16x amplification before `tool_execution_start`. Replay ratio is telemetry,
58
+ not a kill prerequisite. Threshold overrides are available through the
59
+ `AMASTER_PI_TOOL_ARGUMENT_*` environment variables, but production changes
60
+ must be based on shadow telemetry and false-positive review.
61
+
62
+ An enforced stop returns `pi_tool_argument_stream_amplification` with
63
+ `retryable=false` and recommends
64
+ `upsert_document_revision_from_workspace_file`. The command result keeps only
65
+ byte counts, ratios, event/tool identity, thresholds, and near-miss distances;
66
+ it omits the inline argument body.
67
+
68
+ Pi JSON mode can also repeat a cumulative `message` snapshot beside each
69
+ incremental `message_update`. The daemon compacts only that redundant snapshot
70
+ from its retained parse/result buffer while preserving the delta, terminal
71
+ events, live logs, and tool-argument guard input. Output telemetry reports both
72
+ `rawOutputBytes` and `retainedOutputBytes` plus `retentionCompactedBytes`; flood
73
+ limits continue to use raw bytes, so retention compaction never hides transport
74
+ pressure or weakens the 50 MiB safety boundary.
75
+
35
76
  ## Pi terminal cleanup outcome
36
77
 
37
78
  Pi execution uses three separate evidence layers: