instar 1.3.1995 → 1.3.1997
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/dashboard/docs/doc-page-model.js +1 -1
- package/dist/commands/machine.d.ts.map +1 -1
- package/dist/commands/machine.js +9 -0
- package/dist/commands/machine.js.map +1 -1
- package/dist/core/types.d.ts +10 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
- package/dist/messaging/TelegramAdapter.js +13 -20
- package/dist/messaging/TelegramAdapter.js.map +1 -1
- package/dist/messaging/ownerChatTap.d.ts +55 -0
- package/dist/messaging/ownerChatTap.d.ts.map +1 -0
- package/dist/messaging/ownerChatTap.js +41 -0
- package/dist/messaging/ownerChatTap.js.map +1 -0
- package/dist/monitoring/GreenPrAutoMerger.d.ts +2 -0
- package/dist/monitoring/GreenPrAutoMerger.d.ts.map +1 -1
- package/dist/monitoring/GreenPrAutoMerger.js +22 -8
- package/dist/monitoring/GreenPrAutoMerger.js.map +1 -1
- package/dist/monitoring/greenPrAutomergeWiring.d.ts.map +1 -1
- package/dist/monitoring/greenPrAutomergeWiring.js +5 -1
- package/dist/monitoring/greenPrAutomergeWiring.js.map +1 -1
- package/dist/monitoring/greenPrOpenPrList.d.ts +5 -1
- package/dist/monitoring/greenPrOpenPrList.d.ts.map +1 -1
- package/dist/monitoring/greenPrOpenPrList.js +38 -6
- package/dist/monitoring/greenPrOpenPrList.js.map +1 -1
- package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
- package/dist/native/instar-desktop-host +0 -0
- package/dist/server/AgentServer.d.ts +3 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +34 -6
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/documentLinkRoutes.d.ts.map +1 -1
- package/dist/server/documentLinkRoutes.js +14 -2
- package/dist/server/documentLinkRoutes.js.map +1 -1
- package/dist/server/machineRoutes.d.ts +2 -0
- package/dist/server/machineRoutes.d.ts.map +1 -1
- package/dist/server/machineRoutes.js +5 -0
- package/dist/server/machineRoutes.js.map +1 -1
- package/dist/server/throwawayOwnerChat.d.ts +174 -0
- package/dist/server/throwawayOwnerChat.d.ts.map +1 -0
- package/dist/server/throwawayOwnerChat.js +538 -0
- package/dist/server/throwawayOwnerChat.js.map +1 -0
- package/dist/server/throwawayOwnerChatRoutes.d.ts +19 -0
- package/dist/server/throwawayOwnerChatRoutes.d.ts.map +1 -0
- package/dist/server/throwawayOwnerChatRoutes.js +32 -0
- package/dist/server/throwawayOwnerChatRoutes.js.map +1 -0
- package/package.json +1 -1
- package/src/data/awareness/throwaway-owner-chat.md +12 -0
- package/src/data/builtin-manifest.json +4 -4
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/src/data/state-coherence-registry.json +17 -0
- package/upgrades/1.3.1996.md +24 -0
- package/upgrades/1.3.1997.md +28 -0
- package/upgrades/side-effects/document-computer-link-owner-refusal.md +19 -0
- package/upgrades/side-effects/merge-line-exact-handoff.md +32 -0
- package/upgrades/side-effects/throwaway-owner-chat.md +127 -0
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Stand-in owner chat on throwaway test agents
|
|
3
|
+
---
|
|
4
|
+
For live tests of the phone approval screens, a throwaway test agent can keep its owner-chat messages (codes and Approve or Decline buttons) in a local file instead of sending them to Telegram, and a test on the same computer reads and presses them. It is on only when `liveTest.throwawayOwnerChat.enabled` is true AND the agent's folder really is in a temporary folder with an expiring throwaway record AND it has no messaging adapter, owner, operator, introducer, earlier owner key, earlier device or other machine. On any other agent it never exists, and once a condition fails it shuts off for good. A home that ever used it is never paired with another machine. The routes need the agent's own token from this computer only:
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
curl -H "Authorization: Bearer $AUTH" "http://localhost:{{port}}/throwaway/owner-chat/messages?after=0"
|
|
8
|
+
curl -X POST -H "Authorization: Bearer $AUTH" -H 'Content-Type: application/json' -d '{"messageId":1,"button":0}' http://localhost:{{port}}/throwaway/owner-chat/tap
|
|
9
|
+
curl -X POST -H "Authorization: Bearer $AUTH" -H 'Content-Type: application/json' -d '{"text":"/approver_reset"}' http://localhost:{{port}}/throwaway/owner-chat/command
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
A run proves the app screens and the server agree; it does not prove real Telegram delivery or a real device, so always name the stand-in when reporting a result. Spec: `docs/specs/throwaway-owner-chat.md`.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-11-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-11-24T09:31:30.474Z",
|
|
5
|
+
"instarVersion": "1.3.1997",
|
|
6
6
|
"entryCount": 210,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -796,7 +796,7 @@
|
|
|
796
796
|
"type": "route-group",
|
|
797
797
|
"domain": "coordination",
|
|
798
798
|
"sourcePath": "src/server/machineRoutes.ts",
|
|
799
|
-
"contentHash": "
|
|
799
|
+
"contentHash": "4a544aae7a72b94818c614ec5624005210906577da737f9004e504a57c052e9a",
|
|
800
800
|
"since": "2025-01-01"
|
|
801
801
|
},
|
|
802
802
|
"route-group:secret-drop": {
|
|
@@ -1596,7 +1596,7 @@
|
|
|
1596
1596
|
"type": "subsystem",
|
|
1597
1597
|
"domain": "server",
|
|
1598
1598
|
"sourcePath": "src/server/AgentServer.ts",
|
|
1599
|
-
"contentHash": "
|
|
1599
|
+
"contentHash": "a289c8733fd790dafbd6d316fe0b6efbcdf0d2ddfe658886316d03df0df1c97c",
|
|
1600
1600
|
"since": "2025-01-01"
|
|
1601
1601
|
},
|
|
1602
1602
|
"subsystem:session-manager": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"generatedFrom": "source-tree",
|
|
4
4
|
"registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
|
|
5
|
-
"packageVersion": "1.3.
|
|
5
|
+
"packageVersion": "1.3.1997",
|
|
6
6
|
"guards": [
|
|
7
7
|
{
|
|
8
8
|
"ref": "docs/audits/phase-b/f10-triage.md",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sha256": "
|
|
2
|
+
"sha256": "e4e95589ad4ec1d00e50ed4b9d6621886324e5f5ef3e1502863703586eb9ac2a",
|
|
3
3
|
"registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
|
|
4
|
-
"packageVersion": "1.3.
|
|
4
|
+
"packageVersion": "1.3.1997"
|
|
5
5
|
}
|
|
@@ -3013,6 +3013,23 @@
|
|
|
3013
3013
|
"keepSegments": 1,
|
|
3014
3014
|
"note": "action-checks.jsonl rotates at 5 MB into one kept segment (.1); message-notes.jsonl rotates at 1 MB into one kept segment and is emptied at each session start; pending checks expire after 30 minutes; the cache drops entries older than ten minutes."
|
|
3015
3015
|
}
|
|
3016
|
+
},
|
|
3017
|
+
{
|
|
3018
|
+
"category": "throwaway-owner-chat",
|
|
3019
|
+
"description": "The stand-in owner chat of a throwaway test agent (docs/specs/throwaway-owner-chat.md): the log of owner-chat messages, taps and commands, and its state file (first build, adopted owner-record genesis, shut-off record). Exists only on a single-machine throwaway in a temporary folder with no owner; never replicated, synced or backed up, and its presence refuses machine pairing for the life of the home.",
|
|
3020
|
+
"scope": "machine-local",
|
|
3021
|
+
"freshness": "real-time",
|
|
3022
|
+
"conflictShape": "single-writer",
|
|
3023
|
+
"transport": "none",
|
|
3024
|
+
"paths": [
|
|
3025
|
+
"state/throwaway-owner-chat.jsonl",
|
|
3026
|
+
"state/throwaway-owner-chat.json"
|
|
3027
|
+
],
|
|
3028
|
+
"grandfathered": false,
|
|
3029
|
+
"retention": {
|
|
3030
|
+
"class": "size-bounded",
|
|
3031
|
+
"note": "Append-only log under a 16 MiB byte budget that refuses new entries rather than evicting; the whole home is deleted with the throwaway."
|
|
3032
|
+
}
|
|
3016
3033
|
}
|
|
3017
3034
|
]
|
|
3018
3035
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
A throwaway test agent can now use a stand-in for the owner's private Telegram chat, so the phone approval screens can be driven live without a real owner. With `liveTest.throwawayOwnerChat.enabled` set, the stand-in is on only when the agent's folder really is in a temporary folder with an unexpired throwaway record, there is no messaging adapter, owner id, operator, introducer, earlier owner key, earlier device or other machine, and no other agent home shares its machine identity. It keeps the owner-chat messages in `.instar/state/throwaway-owner-chat.jsonl`, and a test on the same computer holding the agent token reads them and presses their buttons through `/throwaway/owner-chat/messages`, `/throwaway/owner-chat/tap` and `/throwaway/owner-chat/command`, which go through the same approval handlers a Telegram tap uses. If a condition stops holding it shuts off for good and declines what it carried; a home that used it is never paired with another machine. The Approve and Decline words are now shared between Telegram and the stand-in (unchanged). On every other agent nothing changes.
|
|
9
|
+
|
|
10
|
+
## What to Tell Your User
|
|
11
|
+
|
|
12
|
+
- **Nothing changes for you**: "This is a test tool for my developers. It lets a throwaway test agent pretend to have an owner's private chat, so the phone approval screens can be tested without using your real Telegram. It can never switch on for me or any real agent."
|
|
13
|
+
|
|
14
|
+
## Summary of New Capabilities
|
|
15
|
+
|
|
16
|
+
| Capability | How to Use |
|
|
17
|
+
|-----------|-----------|
|
|
18
|
+
| Stand-in owner chat for throwaway test agents (read codes, press Approve or Decline from the same computer) | `liveTest.throwawayOwnerChat.enabled` on a qualifying throwaway; `GET /throwaway/owner-chat/messages`, `POST /throwaway/owner-chat/tap`, `POST /throwaway/owner-chat/command` |
|
|
19
|
+
|
|
20
|
+
## Evidence
|
|
21
|
+
|
|
22
|
+
- `tests/e2e/throwaway-owner-chat-alive.test.ts`: on the production server boot, a temp-folder throwaway pairs a phone through the stand-in's Approve tap (the phone reads `active`, `approvedVia: 'telegram-dm'`) and declines a second; with Telegram configured the stand-in is refused and its routes answer 404.
|
|
23
|
+
- `tests/integration/throwaway-owner-chat.test.ts`: adding a messaging entry mid-run shuts it off, ends the pairing it carried, and its routes answer 410.
|
|
24
|
+
- `tests/unit/throwawayOwnerChat.test.ts`, `tests/unit/throwawayOwnerChat-pairing.test.ts`: every refusal, the route gate, bounds, the sweep and the pairing refusal.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The computer link page now explains how to find People under the agent in the iPhone app. If an owner scans a team member's QR code, the server directs them to the dashboard's browser approval steps.
|
|
9
|
+
|
|
10
|
+
The verification merge line reads the exact green pull request directly instead of requiring it to appear among the oldest hundred authored discovery entries. It preserves current author, repository, commit, hold, full-verification and safe-merge checks.
|
|
11
|
+
|
|
12
|
+
## What to Tell Your User
|
|
13
|
+
|
|
14
|
+
Open Agents in the iPhone app, select your agent, then scroll to People. If you own the agent, open its dashboard on the computer and follow the browser approval steps.
|
|
15
|
+
|
|
16
|
+
A finished change can reach the merge checks even when a long queue puts it outside the routine scan. This does not let a change skip testing or approval requirements.
|
|
17
|
+
|
|
18
|
+
## Summary of New Capabilities
|
|
19
|
+
|
|
20
|
+
None. This clarifies the two existing ways to set up a computer.
|
|
21
|
+
|
|
22
|
+
No new user action or setting. This repairs the existing handoff from complete verification to merge checks.
|
|
23
|
+
|
|
24
|
+
## Evidence
|
|
25
|
+
|
|
26
|
+
The wording, HTTP and production server test suites passed.
|
|
27
|
+
|
|
28
|
+
An unchanged-runtime regression reproduced the exact not-listed refusal while forty existing unit checks passed. Actual enforcing focused verification passed107unit, one HTTP and one production-construction/start lifecycle check, zero failures/skips, all exitszero. Build and TypeScript passed. Complete exact-head verification remains required after publication; no live result is claimed here.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Computer link directions and owner refusal
|
|
2
|
+
|
|
3
|
+
Tier 1. This is a reversible change to the display and order of an existing refusal. The device registry identifies the already authenticated phone. Both the explicit and legacy owner roles are refused before the member-only storage checks. Team phones still require current team standing and an intact signed record before linking. The backend continues to refuse unknown roles.
|
|
4
|
+
|
|
5
|
+
- Over-block: The owner remained ineligible for this flow before the change. Team phones use the same checks as before.
|
|
6
|
+
- Under-block: Existing checks for scope, expiry, host, signed requests and allowances still determine what a team phone may do.
|
|
7
|
+
- Layer and authority: The route owns its response, and the dashboard owns the navigation copy. Under docs/signal-vs-authority.md, the message explains an existing authority decision and adds no new permission.
|
|
8
|
+
- Interactions: Refusal happens before nonce use, browser creation or any log write. Member requests still fail closed if team storage is unavailable.
|
|
9
|
+
- Rollback: Revert the commit. No data migration or config change is needed.
|
|
10
|
+
- Evidence: 6 wording tests, 18 HTTP tests and 10 production server lifecycle tests passed. The HTTP regression checks the owner and member responses with no team log and verifies no events were written.
|
|
11
|
+
|
|
12
|
+
Independent review: Concur with the review. The early role check follows the existing owner mapping and adds no authority.
|
|
13
|
+
|
|
14
|
+
## 6b. Operator-surface quality
|
|
15
|
+
|
|
16
|
+
1. The scan page leads with the QR and the steps to reach the scanner. The owner's refusal leads with opening the agent dashboard and following browser approval.
|
|
17
|
+
2. The page and the refusal show familiar app labels and actions. They expose no storage detail, identifier or server status as primary content.
|
|
18
|
+
3. The change adds no destructive controls. Linking itself still requires the existing confirmation.
|
|
19
|
+
4. The directions are short sentences. The updated navigation is a single line of plain text that wraps at phone width.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Exact Green Merge Handoff Review
|
|
2
|
+
|
|
3
|
+
## Scope and proportion
|
|
4
|
+
Tier1/SMALL, narrow reversible read-path repair. Critical merge-pipeline risk floor acknowledged: this is not authorization widening, but the files participate in merge decisions and need an independent second pass. Production exact handoffs read one current candidate by number rather than depending on bounded discovery. Regular oldest-first discovery remains unchanged; no new persisted schema, credential, source trust, queue cap or full-green authority. Twelve in-scope files plus the trace: three runtime read/wiring files, unit/HTTP/lifecycle coverage and explanatory artifacts. One substantive source review round caught discovery-state overreach before GREEN; one final actual-results read followed.
|
|
5
|
+
|
|
6
|
+
## Over-block
|
|
7
|
+
An absent, malformed, wrong-number, non-open, non-main, unknown hold-relevant field, non-viewer-author or cross-repository target yields no candidate. A valid target can still wait for mergeability, reviews or existing holds. The direct read must establish facts, not infer readiness from its existence. Legacy injected dependency consumers without the optional read seam retain old bounded-list behavior; production construction wires the real seam.
|
|
8
|
+
|
|
9
|
+
## Under-block
|
|
10
|
+
The query does not authorize merging. Author/namespace eligibility, fork refusal, draft/title/label holds, pinned head and exact local record are evaluated through existing gather; existing lease, warm-up and latch gates plus act-time hold/head and code-owner/safe-merge checks remain. A failure cannot substitute another listed candidate. GraphQL author must equal authenticated viewer exactly, matching discovery; current watcher account guard still applies. Missing isCrossRepository or draft/title/label/head fields are not converted into permissive defaults.
|
|
11
|
+
|
|
12
|
+
## Layer and signal versus authority
|
|
13
|
+
Reference: docs/signal-vs-authority.md. The bounded discovery list is a discovery signal, not an authoritative statement that an exact verified target is absent. The new direct GitHub projection supplies current facts to the existing watcher authority. No detector independently grants a merge. Ordinary merge runner/safe-merge and existing local floor retain the final decision.
|
|
14
|
+
|
|
15
|
+
## Interactions
|
|
16
|
+
The regular discovery list/page bounds are untouched. Exact production handoffs perform one direct GraphQL read with the same candidate projection and avoid discovery latency/cutoff. Read failures feed existing breaker/error accounting and return a distinct handoff-read-failed result. A direct read does not update the last successful discovery-list timestamp or replace its snapshot, namespace/ownership diagnostics or red-alert memory. An exact-target response does not establish that unrelated candidates disappeared. Independent review caught and corrected this full-list/singleton conflation before GREEN. Existing single-flight handoff waiting, lease warm-up and latch checks remain; no queued ordinary candidate is merged in place of the requested head. The existing merge-line status reconciliation still runs before watcher handoff.
|
|
17
|
+
|
|
18
|
+
## External surfaces
|
|
19
|
+
One exact GitHub read replaces periodic-list reads for a known handoff. No new public endpoint or user flag. The feature does not push or merge during tests: GitHub/process boundaries are fixture-controlled. Audit names handoff-read and whether the candidate was found; no raw body/source/credentials are logged. Actual live claims wait for publication, complete verification and normal release.
|
|
20
|
+
|
|
21
|
+
## Multi-machine posture
|
|
22
|
+
Machine-local watcher and serving lease, by design. The exact source/read remains tied to the executing coordinator account; the adapter uses the existing authenticated runtime. No peer attestation trust, lease-transfer behavior or cross-machine merge authority changes. The Laptop remains excluded from testing per Justin/Chief instruction.
|
|
23
|
+
|
|
24
|
+
## Rollback
|
|
25
|
+
Revert source and redeploy normally. No data migration or external compensation. Existing holds and exact records remain. The old cutoff limitation returns, so a green target may again need a manual supported handoff; no safety rule must be weakened to roll back.
|
|
26
|
+
|
|
27
|
+
## Evidence
|
|
28
|
+
Actual baseline whole-file unit command reproduced one expected not-listed failure with40existing passes, zero skipped, exit1, while runtime was unchanged. Earlier selected -t waiter executed zero tests and was cancelled under explicit root allocation, exit143; both receipts/logs retained. The sole ordinary-enforcing GREEN sequence passed107unit checks (33reader/list,50watcherlocal-floor,24production wiring), one real HTTP integration check and one production-construction/start/rebuild lifecycle check, allzero failures/skips and allthree process exitszero. HTTP elapsed405.39seconds with83milliseconds test execution included ordinary suite admission; lifecycle4.51seconds with59milliseconds test execution. TypeScript and final normal build exitedzero. Runtime/test bytes remained frozen throughout; reviewer found and corrected singleton/full-discovery state conflation before GREEN. No full suite or live fix claimed.
|
|
29
|
+
|
|
30
|
+
## Second-pass review
|
|
31
|
+
**Reviewer:** /root/queue_fastlane.
|
|
32
|
+
Independent reviewer concurred with frozen source/test manifestd0246d4bfe16867dcbad45b269b2ec2f35a90f6fa067bb80e3461e063a10c9e9 after verifying all12file hashes and the discovery-state correction. No reviewer tests or author edits. Final actual-results review: the same independent reviewer read all final source/test/artifact hashes, raw107unit/1HTTP/1lifecycle pass logs and three exit-zero receipts, enforcing admission and build/type evidence. Concur with the review. Runtime/test hashes equal the executed frozen manifest. HTTP elapsed405.39seconds includes admission and startup;83milliseconds is test execution, not an exact wait calculation. No full-gate, publication or live claim is made. The reviewer ran no tests and made no author edits.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Side-Effects Review — A stand-in owner chat for throwaway agents
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `throwaway-owner-chat`
|
|
4
|
+
**Date:** `2026-11-21`
|
|
5
|
+
**Author:** `Echo (identity session, topic 144636)`
|
|
6
|
+
**Second-pass reviewer:** `independent reviewer subagent (see below)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Tier 2. Adds a test-only stand-in for the owner's private Telegram chat that exists only on a single-machine throwaway agent in a temporary folder with no owner (docs/specs/throwaway-owner-chat.md, converged in 6 rounds, approved by Echo on the Chief of Staff's decision 1d8498bd). New: `src/server/throwawayOwnerChat.ts` (conditions, the stand-in, its log and shut-off sweep), `src/server/throwawayOwnerChatRoutes.ts` (three loopback, master-token routes), `src/messaging/ownerChatTap.ts` (the `OwnerChatSurface` seam and the shared Approve/Decline tap wording). Changed: `src/server/AgentServer.ts` (owner DM, owner presence and the Approve/Decline handlers now go through the owner-chat seam; Telegram behaviour unchanged; routes mounted only for a live stand-in; machine pairing blocked for a home that used it), `src/messaging/TelegramAdapter.ts` (tap wording moved into the shared module, same words), `src/server/machineRoutes.ts` (`pairBlocked` refusal in `/api/pair`), `src/commands/machine.ts` (`instar pair` / `instar join` refuse on such a home), `src/core/types.ts` (optional `liveTest.throwawayOwnerChat.enabled`), `src/data/state-coherence-registry.json` (one machine-local row), `src/data/awareness/throwaway-owner-chat.md`. About 700 lines of source and 600 of tests.
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `evaluateStandIn` four conditions — add — invariant facts read from the agent's own files; refuse on any.
|
|
15
|
+
- Stand-in route gate (`standInCallerAllowed`) — add — master bearer exactly, no device header, no Origin, own loopback host.
|
|
16
|
+
- Shut-off for good vs unsure — add — a definitely-false fact shuts off and sweeps; a failed read only withholds one use.
|
|
17
|
+
- `/api/pair`, `instar pair`, `instar join` — modify — refused for a home that ever built the stand-in (and `/api/pair` also while it is not off).
|
|
18
|
+
- `approvalPath()` owner presence (`telegramOwnerPresent`) — modify — true for a live-or-unsure stand-in on an agent with no Telegram; unchanged with Telegram.
|
|
19
|
+
- Telegram Approve/Decline taps — pass-through — same checks, same words, now read from `ownerChatTap.ts`.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 1. Over-block
|
|
24
|
+
|
|
25
|
+
The conditions refuse some legitimate test homes: a throwaway with a disabled messaging entry left in its config, one created with a paired device already in it, one whose record expired mid-run (shut off for good; a new throwaway is needed), and one whose home folder was copied from another agent. Each refusal is logged with its condition, and the remedy is always "make a fresh throwaway", which is the intended workflow. The route gate refuses a test that sends an `Origin` header (a browser page) or uses a dashboard session instead of the agent token; a test must use curl or similar with the agent token, which the awareness entry shows.
|
|
26
|
+
|
|
27
|
+
## 2. Under-block
|
|
28
|
+
|
|
29
|
+
A determined process running as the same user can forge the stand-in's own state file, copy keys, or build a temp-folder agent by hand; the spec says plainly that the conditions stop accidental and single-edit paths, not such a process, which already holds the machine signing keys and bearer token. A raw port-forward on this computer that rewrites Host to `localhost:<port>` and adds no forwarding headers passes the loopback check; it needs local process access and the bearer is still required. A listed path that is not an agent home has no identity to compare; an identity file that exists but cannot be read makes the use unsure, never a non-match.
|
|
30
|
+
|
|
31
|
+
## 3. Level-of-abstraction fit
|
|
32
|
+
|
|
33
|
+
The stand-in sits at the owner-chat seam, the lowest layer at which the approval flows can be fed without a second code path: the flows call `ownerDM` and the handler slots exactly as they do with Telegram, and the stand-in reuses the production handlers and the shared tap wording. The location and expiry facts reuse `ThrowawayAgentGuard` (with a stricter real-path check, explained in the spec); the loopback check reuses `ownLoopbackHost`; the bearer check reuses `bearerMatches` (guarded against its "no token configured" true).
|
|
34
|
+
|
|
35
|
+
## 4. Signal vs authority compliance
|
|
36
|
+
|
|
37
|
+
**Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
|
|
38
|
+
|
|
39
|
+
- [ ] No — this change produces a signal consumed by an existing smart gate.
|
|
40
|
+
- [ ] No — this change has no block/allow surface.
|
|
41
|
+
- [ ] Yes — but the logic is a smart gate with full conversational context (LLM-backed with recent history or equivalent).
|
|
42
|
+
- [x] Yes, deterministic by design on an irreversible safety boundary (not brittle judgment).
|
|
43
|
+
|
|
44
|
+
The refusals are deterministic facts on a safety guard, the case Signal vs Authority reserves for deterministic logic: owner authority on a real agent is irreversible harm, and each condition is an enumerable fact (folder location, a config field, a file's presence), not a judgment over competing signals. The refusals only ever withhold the test fixture; they never block a real user's message, session or action.
|
|
45
|
+
|
|
46
|
+
## 4b. Judgment-point check (Judgment Within Floors standard)
|
|
47
|
+
|
|
48
|
+
No new static heuristic at a competing-signals decision point. The four conditions, the route gate and the shut-off rule are invariants on an irreversible safety boundary, each classified with basis and evidence in the spec's `## Decision points touched`. The byte budget, reserve, per-message cap and page size are labelled resource budgets that refuse rather than evict.
|
|
49
|
+
|
|
50
|
+
## 5. Interactions
|
|
51
|
+
|
|
52
|
+
- **Shadowing:** on a Telegram agent nothing changes: `ownerChat` is the adapter, `telegramOwnerPresent` is the old expression, and the handler loop assigns the same closures to the adapter. `mobileInboundScan` and `onHubPost` stay Telegram-only. A home whose config asks for the stand-in but has Telegram builds a stand-in object that is off at once and never writes a state file, so it never blocks pairing.
|
|
53
|
+
- **Double-fire:** on a home that ran the stand-in and later has Telegram, both surfaces hold the same handlers; only the stand-in's shut-off sweep calls them, once, and only for its own live `md:d:` buttons.
|
|
54
|
+
- **Races:** handlers are synchronous; a shut-off found inside `ownerDM` sweeps re-entrantly while the current send gets `null` ("not delivered"), which the pairing code already handles. `/api/pair` is refused from boot while the stand-in is not off, so a pairing cannot land between an unsure boot and the first recorded build.
|
|
55
|
+
- **Feedback loops:** none; the stand-in sends nothing outward.
|
|
56
|
+
|
|
57
|
+
## 6. External surfaces
|
|
58
|
+
|
|
59
|
+
No change on any agent that does not qualify: `ThrowawayOwnerChat.forBoot` returns null unless the config asks for it or the home ran it before, and no route is mounted. On a qualifying throwaway: three new loopback routes, two state files under `.instar/state/`, a boot log line, and machine pairing refused for the home's life. The Telegram tap words are unchanged (moved, byte-identical). Operator surface: none; this is a test fixture driven by a test process, not an operator action.
|
|
60
|
+
|
|
61
|
+
## 6b. Operator-surface quality (Operator-Surface Quality standard)
|
|
62
|
+
|
|
63
|
+
No operator surface — not applicable.
|
|
64
|
+
|
|
65
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
66
|
+
|
|
67
|
+
Machine-local by design (`hardware-bound-resource` in the spec): the stand-in exists only while the pool has exactly this one machine, machine pairing is refused in both directions for the life of a home that used it, and it shuts off for good if another machine appears anyway, so no second machine ever holds or lacks its state. No user-facing notices (it is a test log); its durable state is not tied to a topic; it generates no URLs. Status surfaces: none new or changed (`/health`, `/capabilities`, `/status`, `/channels` untouched).
|
|
68
|
+
|
|
69
|
+
## 8. Rollback cost
|
|
70
|
+
|
|
71
|
+
Revert the commit and ship a patch. Before running older code on a throwaway that used the stand-in, tear that throwaway down (older code ignores the state file that keeps machine pairing refused); throwaways are temporary test homes and expire on their own. No migration, no real-agent state, no user-visible regression.
|
|
72
|
+
|
|
73
|
+
## Conclusion
|
|
74
|
+
|
|
75
|
+
The review confirmed the design converged in the spec: the stand-in cannot exist on a real agent by any single edit or accident, runs the production approval code, and is fenced from other machines. The build added the seam on main so pieces 3a and 3d plug in with small, listed wiring changes. Clear to ship.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Second-pass review (if required)
|
|
80
|
+
|
|
81
|
+
**Reviewer:** independent reviewer subagent
|
|
82
|
+
**Independent read of the artifact: concur**
|
|
83
|
+
|
|
84
|
+
Audited the code, not the artifact. Safety holds: a real agent's folder fails the fixed-temp-root real-path check (`throwawayOwnerChat.ts:140`, `FIXED_TEMP_ROOTS` is not env-derived) before any write; state is written only on a full pass (`:185`) or when it already exists (`:174`, `recordOff :294`), so a real agent with the switch on never gets a state file and is never pairing-blocked. Telegram taps are byte-identical (words, `editMessageReplyMarkup`, `sendToOwnerDM` text and return values via `ownerChatTap.ts`); `ownerDM`/`telegramOwnerPresent` are unchanged when `options.telegram` exists. Routes need the exact master bearer, no device/Origin header, own loopback Host. The sweep cannot loop (`off` set first; re-entrant sends get null). 40 unit tests pass. Non-blocking findings:
|
|
85
|
+
- Spec §2 says an unreadable other home "counts as not matching"; code makes it unsure (`:120` via `readJsonFile`). A stray file in `~/.instar/agents` (e.g. `.DS_Store`) gives ENOTDIR (verified) and withholds the stand-in on every use. Skip non-directories/ENOTDIR, or fix the spec.
|
|
86
|
+
- `loadLog` skips a torn last line, but the next `appendFileSync` joins onto it (`:450`), so that entry (possibly an `edit`) is lost on the next replay. Write a leading newline when the file does not end in one.
|
|
87
|
+
- `evaluateStandIn` reads config/state before the location check (`:133-134`), so a transient read error on a real agent with the switch on mounts the routes and makes `pairBlocked` (`AgentServer.ts`, which reads only `isOff()`) refuse pairing until the next gate call. Check location first.
|
|
88
|
+
- `finishShutOff` comment at `:310` says a malformed state is "treated as not swept", but it returns without sweeping.
|
|
89
|
+
|
|
90
|
+
**Author's resolution (after the second pass):** all four fixed. The other-home scan lists only folders and reads a not-a-folder path as "no identity" (`ENOTDIR` like `ENOENT`), while an identity file that exists but cannot be read stays unsure; the spec now says exactly that. The log starts a new line after a torn tail (unit test added). The location check now runs before any file read, so a real agent is always refused definitely. The comment was corrected. 41 unit tests pass.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Evidence pointers
|
|
95
|
+
|
|
96
|
+
- `tests/unit/throwawayOwnerChat.test.ts` (37): each refusal, unsure vs off, shut-off sweep (runtime and boot), hook retry, bounds, budget reserve, intents and indeterminate, paging, tap outcome rules, command allowlist, route gate.
|
|
97
|
+
- `tests/unit/throwawayOwnerChat-pairing.test.ts` (3): `/api/pair` refusal and the lifetime marker.
|
|
98
|
+
- `tests/integration/throwaway-owner-chat.test.ts` (2): shut-off mid-run through the HTTP pipeline ends a carried pairing; tunnel host refused.
|
|
99
|
+
- `tests/e2e/throwaway-owner-chat-alive.test.ts` (2): production `AgentServer` boot: built, redeem, Approve tap, signed device read `active` with `approvedVia: 'telegram-dm'`, Decline tap; Telegram-configured boot refused with handlers on the adapter.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Class-Closure Declaration (display-only mirror)
|
|
104
|
+
|
|
105
|
+
No agent-authored-artifact defect — not applicable. The shut-off sweep is a one-shot, self-limiting step (it runs once per shut-off, records `swept`, and re-runs at boot only while a registered hook failed), not a recurring self-triggered controller.
|
|
106
|
+
|
|
107
|
+
## Current-main conflict repair, 2026-11-23
|
|
108
|
+
|
|
109
|
+
Tier 2 maintenance under this existing approved spec. Normal merge of main ea3bc4574de878058677a5077b366a8f10431330 into PR3626 head 0a97fad42e2570693609c7d592331bf2c18834cb had one conflict, in TelegramAdapter imports. Retained both the harness shared tap helpers and main's learningOwnerId import. No unrelated feature or path is deleted against main. Production throwaway-only conditions, Telegram priority, isolated ownerChat seam, never assigning stand-in to options.telegram, permanent pairing block and master bearer/loopback/no-device/no-Origin route checks remain unchanged. There is no new runtime authority or test-to-production migration.
|
|
110
|
+
|
|
111
|
+
Independent parent source review inspected the actual merged candidate and concurred: all named throwaway and production controls survive; no material merge defect found. Focused verification passed all three tiers: 41 unit tests across two harness files, two real HTTP integration tests, and two production-wiring E2E cases, plus TypeScript checking. Full suites remain exclusively with the throughput coordinator; no full pass is claimed. All native and identity dependency holds remain unchanged. Frozen approval PR3660 and parked native design lanes were not modified.
|
|
112
|
+
|
|
113
|
+
Existing over-block, under-block, signal-versus-authority, multi-machine and rollback analysis above continues to apply without a new decision boundary. Rollback is a normal revert of the merge repair, returning the stale prerequisite branch. One independent merge review and one planned commit attempt; no new design review rounds or behavioral limits.
|
|
114
|
+
|
|
115
|
+
## Release1989 refresh, 2026-11-23
|
|
116
|
+
|
|
117
|
+
Tier2 maintenance of the existing approved throwaway-owner-chat spec. Merge origin/main ec9401e5bdf28ed5ab1ff13f88e0032cc7895fc6 (release1989) into prior ee7ac32e0d784f4439c33d95f77b66e01b2132ce. The only conflict was Git's suggestion to move the still-unreleased fragment out of upgrades/next. Kept it in upgrades/next byte-for-byte, preserving its normal release-assembly path. Trimmed one imported blank EOF line from the trust-journey account-path unit test for normal diff checking. The machine.ts/machineRoutes.ts auto-merges preserve the harness pairing ban and main's minimum-build fencing. No harness runtime source or test assertion changed relative to the two-parent auto-merge.
|
|
118
|
+
|
|
119
|
+
Existing over-block, under-block, layer fit, signal-versus-authority, interactions, external-surface, multi-machine and rollback analysis continues to apply: no new decision boundary, credential, consent, data migration, notification or production activation. Source guards, fixed temporary roots, master authorization, loopback-only routes, production Telegram priority, outside-source fixture placement and native/dependency holds remain intact. Reverting this merge is the rollback; no durable production state was changed.
|
|
120
|
+
|
|
121
|
+
Build isolation: the managed fresh worktree helper timed out copying files and rolled back its target; this repair therefore continued in its existing clean isolated maintenance checkout, merging current canonical main before conflict resolution. No helper lock was removed or bypassed. Full test:all is exclusively with throughput after Chief publishes the exact successor; focused results do not grant a full-suite pass or release any hold. Effort: one maintenance review, no new design rounds, one intended normal commit.
|
|
122
|
+
|
|
123
|
+
Verification and the independent reviewer response are recorded below after completion.
|
|
124
|
+
|
|
125
|
+
Release1989 focused verification:41unit,2real HTTP,2production-path E2E and TypeScript noEmit all passed on matching Node22.23.5 with the existing native database addon verified loadable. InitialNode24 runs also passed all45cases but reported native-addon mismatch; these were not used as the clean verification evidence. No shared dependency rebuild was performed. Exact full-suite verification on the published successor remains required through throughput.
|
|
126
|
+
|
|
127
|
+
Independent second-pass reviewer /root/review_3626_release_refresh: Concur. The actual release1989 merge and appendix match; the fragment is byte-identical, all conflicts resolved, both pairing ban and minimum-build fence retained, and fixed temporary roots/master authorization/loopback/Telegram priority/outside-source fixtures preserved. No material concern. Full verification and safety holds remain required.
|