@amaster.ai/employee-runtime-connector 0.1.1-beta.4 → 0.1.1-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
 
@@ -21,17 +21,59 @@ Do not use `latest`, `^`, or `~` in a runtime image. The image tag and connector
21
21
 
22
22
  Immutable images should pin an exact package version as their baseline. The current connector does not download or replace runtime code while running; package upgrades and rollbacks belong to the image build and rollout.
23
23
 
24
- The publish workflow verifies that npm records the publishing commit as the package `gitHead`, then updates the repository deployment pin. Remote deployment accepts that package only when its `gitHead` is an ancestor of the target source commit and the connector package path is unchanged between them. This path-only comparison is valid because the published connector is self-contained; if runtime code starts importing workspace source outside this package, expand the provenance scope and tests before release. After restart, deployment also verifies the package CLI version inside the container. Do not update the deployment pin manually to bypass either provenance check.
24
+ The publish workflow verifies that npm records the publishing commit as the package `gitHead`, then updates the repository deployment pin. Remote deployment accepts that package only when its `gitHead` is an ancestor of the target source commit and the connector runtime build inputs are unchanged between them. Those inputs are the package path plus `packages/shared/src/source-acquisition-compatibility.json`, which is copied into the published package and bundled into the daemon. If another workspace source becomes a runtime build input, expand the provenance scope and tests before release. After restart, deployment also verifies the package CLI version inside the container. Do not update the deployment pin manually to bypass either provenance check.
25
25
 
26
26
  ## Package Contents
27
27
 
28
28
  - `dist/amaster-runtime.mjs`: configuration, pairing, workspace, diagnostics, and daemon lifecycle CLI.
29
29
  - `dist/amaster-runtime-daemon.mjs`: standalone daemon bundle for connector registration, heartbeat, command execution, and result ingestion.
30
+ - `dist/source-acquisition-compatibility.json`: versioned Source Acquisition compatibility manifest. Runner image builds must read this file from the exact installed connector package and fail before publishing when their Source Acquisition profile, adapter, or required package versions do not match it.
30
31
 
31
32
  The source of truth lives under this package's `src/` directory. The package build copies the CLI and bundles the daemon modules into publishable output; do not edit generated files under `dist/`.
32
33
 
33
34
  Runtime code belongs in the container image. Persist only connector state, the result outbox, and workspaces under the configured state directory.
34
35
 
36
+ ## Contracted Pi model calls
37
+
38
+ Pi `model_call` commands with `model_call_output_contract_v1` keep provider and
39
+ model selection paired with the output ceiling. Command target fields have the
40
+ highest precedence, followed by `AMASTER_PI_PROVIDER` / `AMASTER_PI_MODEL`, then
41
+ the Pi profile's `defaultProvider` / `defaultModel`. Each selected precedence
42
+ layer must be a complete provider/model pair: a partial command or runtime
43
+ override fails closed instead of silently falling through to a lower-precedence
44
+ default. The daemon copies only the normalized default pair into the isolated
45
+ one-shot profile, validates that the resolved model exists, applies
46
+ `maxOutputTokens` to that exact model, and records the resolved target and source
47
+ in command-result diagnostics. Missing or unknown targets also fail closed
48
+ before Pi is spawned.
49
+
50
+ ## Pi tool-argument transport guard
51
+
52
+ `AMASTER_PI_TOOL_ARGUMENT_GUARD_MODE` defaults to `shadow`; supported values are
53
+ `off`, `shadow`, and `enforce`. Shadow records metadata-only matches while the
54
+ single-incident thresholds are calibrated. Promote deliberately to `enforce`
55
+ after reviewing near misses and false positives; use `off` as the emergency
56
+ rollback. The enforce signature
57
+ requires at least 8 MiB transported, at most 512 KiB materialized, and at least
58
+ 16x amplification before `tool_execution_start`. Replay ratio is telemetry,
59
+ not a kill prerequisite. Threshold overrides are available through the
60
+ `AMASTER_PI_TOOL_ARGUMENT_*` environment variables, but production changes
61
+ must be based on shadow telemetry and false-positive review.
62
+
63
+ An enforced stop returns `pi_tool_argument_stream_amplification` with
64
+ `retryable=false` and recommends
65
+ `upsert_document_revision_from_workspace_file`. The command result keeps only
66
+ byte counts, ratios, event/tool identity, thresholds, and near-miss distances;
67
+ it omits the inline argument body.
68
+
69
+ Pi JSON mode can also repeat a cumulative `message` snapshot beside each
70
+ incremental `message_update`. The daemon compacts only that redundant snapshot
71
+ from its retained parse/result buffer while preserving the delta, terminal
72
+ events, live logs, and tool-argument guard input. Output telemetry reports both
73
+ `rawOutputBytes` and `retainedOutputBytes` plus `retentionCompactedBytes`; flood
74
+ limits continue to use raw bytes, so retention compaction never hides transport
75
+ pressure or weakens the 50 MiB safety boundary.
76
+
35
77
  ## Pi terminal cleanup outcome
36
78
 
37
79
  Pi execution uses three separate evidence layers: