instar 1.3.1979 → 1.3.1981
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/dist/commands/machine.d.ts.map +1 -1
- package/dist/commands/machine.js +5 -1
- package/dist/commands/machine.js.map +1 -1
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +11 -2
- package/dist/commands/server.js.map +1 -1
- package/dist/core/UpdateChecker.d.ts.map +1 -1
- package/dist/core/UpdateChecker.js +24 -0
- package/dist/core/UpdateChecker.js.map +1 -1
- package/dist/core/identityBuildFence.d.ts +97 -0
- package/dist/core/identityBuildFence.d.ts.map +1 -0
- package/dist/core/identityBuildFence.js +198 -0
- package/dist/core/identityBuildFence.js.map +1 -0
- package/dist/core/ownerRecordStore.d.ts +2 -0
- package/dist/core/ownerRecordStore.d.ts.map +1 -1
- package/dist/core/ownerRecordStore.js +2 -0
- package/dist/core/ownerRecordStore.js.map +1 -1
- package/dist/core/ownerRecordSync.d.ts +43 -1
- package/dist/core/ownerRecordSync.d.ts.map +1 -1
- package/dist/core/ownerRecordSync.js +115 -6
- package/dist/core/ownerRecordSync.js.map +1 -1
- package/dist/core/ownerRecordWiring.d.ts +19 -1
- package/dist/core/ownerRecordWiring.d.ts.map +1 -1
- package/dist/core/ownerRecordWiring.js +37 -2
- package/dist/core/ownerRecordWiring.js.map +1 -1
- package/dist/core/ownerWords.d.ts +9 -2
- package/dist/core/ownerWords.d.ts.map +1 -1
- package/dist/core/ownerWords.js +19 -1
- package/dist/core/ownerWords.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/install/accountChoice.d.ts.map +1 -1
- package/dist/install/accountChoice.js +8 -6
- package/dist/install/accountChoice.js.map +1 -1
- package/dist/messaging/TelegramAdapter.d.ts +5 -0
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
- package/dist/messaging/TelegramAdapter.js +8 -0
- package/dist/messaging/TelegramAdapter.js.map +1 -1
- package/dist/monitoring/contextLayers/h3Builder.d.ts +1 -1
- package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
- package/dist/native/instar-desktop-host +0 -0
- package/dist/server/machineRoutes.d.ts.map +1 -1
- package/dist/server/machineRoutes.js +13 -0
- package/dist/server/machineRoutes.js.map +1 -1
- package/dist/server/ownerRecordRoutes.d.ts.map +1 -1
- package/dist/server/ownerRecordRoutes.js +2 -0
- package/dist/server/ownerRecordRoutes.js.map +1 -1
- package/dist/server/phoneSetupRoutes.d.ts.map +1 -1
- package/dist/server/phoneSetupRoutes.js +11 -0
- package/dist/server/phoneSetupRoutes.js.map +1 -1
- package/dist/server/sameNetworkListener.d.ts +39 -5
- package/dist/server/sameNetworkListener.d.ts.map +1 -1
- package/dist/server/sameNetworkListener.js +102 -16
- package/dist/server/sameNetworkListener.js.map +1 -1
- package/dist/server/sameNetworkRefusals.d.ts +59 -0
- package/dist/server/sameNetworkRefusals.d.ts.map +1 -0
- package/dist/server/sameNetworkRefusals.js +154 -0
- package/dist/server/sameNetworkRefusals.js.map +1 -0
- package/dist/testing/selfActionRegistry.d.ts.map +1 -1
- package/dist/testing/selfActionRegistry.js +27 -0
- package/dist/testing/selfActionRegistry.js.map +1 -1
- package/package.json +1 -1
- package/src/data/awareness/owner-record.md +1 -0
- package/src/data/awareness/same-network-first-phone.md +1 -0
- package/src/data/builtin-manifest.json +3 -3
- 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/upgrades/1.3.1980.md +34 -0
- package/upgrades/1.3.1981.md +37 -0
- package/upgrades/side-effects/account-choice-never-silent.eli16.md +19 -0
- package/upgrades/side-effects/account-choice-never-silent.md +53 -0
- package/upgrades/side-effects/home-listener-phone-limits.md +59 -0
- package/upgrades/side-effects/identity-security-piece2c-minimum-build-fence.md +120 -0
- package/upgrades/side-effects/owner-words-owner-unknown.md +30 -0
package/package.json
CHANGED
|
@@ -4,4 +4,5 @@ title: Owner record on every machine
|
|
|
4
4
|
Each of my machines keeps a signed owner record: which keys speak for the owner, which machines belong to me, and my security level. It is kept in step over signed mesh messages, and each machine checks every entry itself. Before saying anything about the owner's devices, my security level, or why a risky action is held, I read it: `curl -H "Authorization: Bearer $AUTH" http://localhost:{{port}}/owner-record`.
|
|
5
5
|
- `gate.act` is `basic` (today's rules), `record` (the record decides) or `hold`. A hold refuses Sensitive and Serious actions but still allows viewing. `gate.enrolment` says whether the owner never enrolled, enrolled, or it is unknown.
|
|
6
6
|
- `waitingOn` names a machine that hasn't answered. If it is gone for good, the administrator-prompt reset on this machine clears the hold.
|
|
7
|
+
- `fence` shows the minimum build once the owner has enrolled, and each machine's confirmed version. Before setting up a phone, every machine must be confirmed. A machine below it can't join, can't be rolled back to, and doesn't get the record. I tell the owner which machine to update or retire.
|
|
7
8
|
- I never edit the record's files: they live in a protected folder and are rebuilt from my other machines.
|
|
@@ -6,4 +6,5 @@ When this agent has no Telegram owner and no address that works away from home (
|
|
|
6
6
|
- The Instar app that created me on this computer does not need the PIN (nobody was told it): just before "Add your phone" it runs `instar mobile ceremony-credential --json` as my own user, inside my own system, and passes that one-time credential instead. It works once, for ten minutes, only from this computer, only for my first phone, and only where the number is typed at the computer. I never run it for a person: a person in a terminal uses `instar mobile add-phone` and the PIN.
|
|
7
7
|
- Inside WSL the home address opens only when WSL's networking mode is read as NAT (`wslMode` in the status says what was read). In mirrored mode it stays closed (`held: wsl-networking-mode`) unless the Windows app said it enforces the network rule; unknown or other modes stay closed.
|
|
8
8
|
- The home address uses port main + 20000 (for example 24040) unless one is already stored; the app may ask for another free port, and `preferredPort` in the status says which one the next open will use.
|
|
9
|
+
- Why a home phone was refused (a 403, a 404, a dropped connection, a TLS error): `curl -H "Authorization: Bearer $AUTH" http://localhost:{{port}}/mobile/same-network/refusals` lists the home listener's recent refusals, newest first: route, status, reason code, the first 8 characters of the phone's device id, the caller address and time (never a header value, body, signature or token). Read it before guessing why a phone said "Signed out" or could not connect. Behind the Windows app every entry's caller address is the app's own, so tell phones apart by the device id prefix; it keeps the latest 300 entries, so a flood can push older ones out.
|
|
9
10
|
- **When to use**: the owner asks to add a phone and there is no tunnel, no Tailscale and no Telegram; or a home phone stopped working after the computer changed network (the owner allows the new network at the computer).
|
|
@@ -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-23T06:35:55.896Z",
|
|
5
|
+
"instarVersion": "1.3.1981",
|
|
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": "187ff6bbcf460e0ffd3581d94a9c8583eb62e3d4b98c32172d6b71b86807150a",
|
|
800
800
|
"since": "2025-01-01"
|
|
801
801
|
},
|
|
802
802
|
"route-group:secret-drop": {
|
|
@@ -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.1981",
|
|
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": "fe22f36d1eab4269f94d71738087ed00cc170d7cd8d8063a24af5b124dae4bb9",
|
|
3
3
|
"registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
|
|
4
|
-
"packageVersion": "1.3.
|
|
4
|
+
"packageVersion": "1.3.1981"
|
|
5
5
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The installer's account-choice step (`src/install/accountChoice.ts`) had a compatibility fallback: when an install was resumed while waiting at `do-account-choice` and the answers file carried no `account` field, it treated the caller as an app from before the question existed and silently used the default config folder (`~/.claude` or `~/.codex`) when it was signed in. That claimed an account the person never chose. It now asks again (`awaiting-person` with the same account cards) and its instruction says to update the Instar app if no choice appears. An answer on resume still completes the step as before. The spec `create-agent-accounts-and-always-on.md` §A.2 is amended to match.
|
|
9
|
+
|
|
10
|
+
SEC-105, a gap left by the SEC-069 fix. `isOwnersOwnWords` returned true for ANY verified Telegram sender when the owner id was undefined, while `getVerifiedOwner()` documents undefined as "no owner is known, never anybody". On an agent with no configured owner, no verified operator, and more than one authorized Telegram sender, a non-owner's words became the owner's learned preferences and fed the Jev correction shadow.
|
|
11
|
+
|
|
12
|
+
`isOwnersOwnWords` now requires a known owner id for a Telegram row. A new `learningOwnerId(verifiedOwner, authorizedUserIds)` picks the id the learners use: the verified owner, else the agent's ONE allowed sender (a single-person agent with no owner configured), else nobody. `TelegramAdapter.getLearningOwner()` exposes it, and both learners now use it: correction capture and the Jev correction shadow (`src/commands/server.ts`). App messages are unchanged (role `owner`, or the owner's own paired phone).
|
|
13
|
+
|
|
14
|
+
## What to Tell Your User
|
|
15
|
+
|
|
16
|
+
- **Setup always asks which account**: "When you create an agent and you're already signed in to Claude or ChatGPT on this computer, setup now always asks which account to use. It never quietly picks one for you, even if you're using an older version of the app."
|
|
17
|
+
|
|
18
|
+
- **Only you teach me your preferences**: "If I don't know who my owner is and several people can message me, I no longer learn 'your' preferences from whoever writes. If you're the only person who can message me, nothing changes."
|
|
19
|
+
|
|
20
|
+
## Summary of New Capabilities
|
|
21
|
+
|
|
22
|
+
| Capability | How to Use |
|
|
23
|
+
|-----------|-----------|
|
|
24
|
+
| The account choice is never skipped on resume | Automatic |
|
|
25
|
+
|
|
26
|
+
| Capability | How to Use |
|
|
27
|
+
|-----------|-----------|
|
|
28
|
+
| Learning from Telegram needs a known owner (or a single allowed sender) | Automatic |
|
|
29
|
+
|
|
30
|
+
## Evidence
|
|
31
|
+
|
|
32
|
+
- `tests/unit/install-account-choice.test.ts`: the old test that expected the silent default is replaced by one that fails on main. For both Claude and ChatGPT, a resume without an answer stays at the step with every account card and the update-the-app instruction, and does not fall through to sign-in with only a non-default account. A second test checks that a resume with an answer still completes. 12/12 pass; neighbouring `install-flow` and `install-accounts` tests pass (54/54).
|
|
33
|
+
|
|
34
|
+
- Unit: `tests/unit/team-words-not-learned.test.ts` covers an unknown owner counting nobody, and `learningOwnerId` returning the verified owner first, then a sole numeric or string allowed id, then nobody when there are several, none, or the id is malformed. A single-person agent still learns; a second sender does not. `tests/unit/jev-correction-shadow.test.ts` covers an unknown owner with a verified non-owner sender never being classified, and the existing cases now pass the owner explicitly. The source pins in `team-guards` and `team-words-not-learned` follow the new `getLearningOwner()` wiring. Adapter tests cover owner precedence, a single sender, two senders and a second sender added at runtime. Edge cases cover `0`, negative group ids, padded or zero-led strings and duplicates. 105 tests in 3 files pass.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The same-network (home) listener's connection limits were sized below what a real phone does: a live iPhone pairing over home Wi-Fi (Windows-made test agent) showed one app screen opening about 8 TLS connections at once, and the 6-open / 40-a-minute per-address limit (32 in all) refused the rest (iOS TLS error -1200). The limits are now 24 open and 240 new a minute per address, 64 in all. In WSL mirrored mode every phone reaches the agent from the Windows pass-through's one loopback address, so that address now gets the whole door (64 open, 960 a minute); the pass-through limits each real phone itself. The home listener also keeps a bounded refusal log (`state/same-network-refusals.json`, at most 300 entries, repeats coalesced, written at most every 2 seconds, mode 0600): connections dropped by a limit, failed TLS handshakes, and every request answered with 400 or more, with route (ids replaced), status, reason code, device id prefix and caller address only. `GET /mobile/same-network/refusals` (bearer, from this computer only) reads it, newest first.
|
|
9
|
+
|
|
10
|
+
Groundwork for the identity and security plan. Each of your agent's computers now tells the others which version of Instar it runs, in a signed message. Nothing changes yet. Once you set up your phone to approve risky actions, a computer on an older version can't join, can't be rolled back to an older version, and doesn't get the ownership ledger. The agent tells you which computer to update.
|
|
11
|
+
|
|
12
|
+
## What to Tell Your User
|
|
13
|
+
|
|
14
|
+
- **Your phone at home connects reliably**: "A phone added at home on the same Wi-Fi could be cut off when an app screen opened several connections at once. That limit now fits a real phone, and when I do turn a phone away I keep a short note of why, so I can tell you what happened."
|
|
15
|
+
|
|
16
|
+
- **Version check across your computers**: "Nothing changes for you now. Later, before you set up your phone for approvals, I'll make sure all your computers run a new enough version, and I'll tell you which one to update if not."
|
|
17
|
+
|
|
18
|
+
## Summary of New Capabilities
|
|
19
|
+
|
|
20
|
+
| Capability | How to Use |
|
|
21
|
+
|-----------|-----------|
|
|
22
|
+
| Home listener limits sized for a real phone (24 open, 240 a minute per device; 64 in all) | Automatic |
|
|
23
|
+
| Why the home listener refused a phone: route, status, reason code, device id prefix | `GET /mobile/same-network/refusals` from the agent's computer |
|
|
24
|
+
|
|
25
|
+
| Capability | How to Use |
|
|
26
|
+
|-----------|-----------|
|
|
27
|
+
| Version fence status | `GET /owner-record` → `fence` |
|
|
28
|
+
|
|
29
|
+
## Evidence
|
|
30
|
+
|
|
31
|
+
- `tests/unit/same-network-home-limits.test.ts`: both sides of every limit with the numbers themselves (24/25 open, 240/241 a minute with the 59 s and 60 s edges, the mirrored loopback door 64/65 and 960/961, another address in mirrored mode still 24), a busy phone of ten 12-connection loads a minute; the refusal log's route reduction, bound, coalescing, private file and restart; a real TLS listener records gate and route refusals, a limit refusal and a failed handshake once each. With the old 6/40/32 put back, 9 of its 19 tests fail (the limit tests).
|
|
32
|
+
- `tests/integration/same-network-refusals.test.ts`: over the real pipeline a stand-in phone's refused requests are recorded without the setup id, PIN, signature or full device id, and the route is bearer and this-computer only.
|
|
33
|
+
- `tests/e2e/same-network-first-phone-alive.test.ts`: the route answers on the production start path and the log survives a restart.
|
|
34
|
+
|
|
35
|
+
- Unit: `tests/unit/identity-piece2c-build-fence.test.ts`.
|
|
36
|
+
- Integration: `tests/integration/identity-piece2c-join-fence.test.ts`.
|
|
37
|
+
- E2E: `tests/e2e/identity-piece2b-owner-record-lifecycle.test.ts` (the build in every pull).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Setup never picks an AI account on its own
|
|
2
|
+
|
|
3
|
+
## What is going on
|
|
4
|
+
|
|
5
|
+
When you create a new Instar agent, you pick Claude or ChatGPT. Many people are already signed in to one or more of those accounts on their computer: a personal account, a work account, or the accounts their other agents use. Since 17 November, setup is supposed to show those accounts and ask which one the new agent should use, or offer to sign in to a different one.
|
|
6
|
+
|
|
7
|
+
That step had a back door. If setup was restarted while it was waiting for this answer, and no answer came with the restart, it assumed it was talking to an older app that didn't know the question. It then quietly used whichever account sat in the usual place. On 19 November Justin said plainly that setup must never just assume and claim an account.
|
|
8
|
+
|
|
9
|
+
## What changes
|
|
10
|
+
|
|
11
|
+
When setup is restarted at that step without an answer, it no longer picks an account. It shows the same list again and waits. Its message says that if no choice appears, the person should update the Instar app and try again. Once an answer arrives, setup carries on exactly as before. If there are no accounts on the computer at all, nothing changes: there is nothing to choose, so setup goes straight to signing in.
|
|
12
|
+
|
|
13
|
+
## Safeguards
|
|
14
|
+
|
|
15
|
+
Nothing is deleted or moved, and no settings change. The current Mac app always sends the answer, so it is not affected. Only an app from before 17 November would now stop and ask for an update instead of silently using an account.
|
|
16
|
+
|
|
17
|
+
## What needs deciding
|
|
18
|
+
|
|
19
|
+
Nothing.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Side-Effects Review — Setup never picks an AI account on its own
|
|
2
|
+
|
|
3
|
+
## Summary of the change
|
|
4
|
+
|
|
5
|
+
Tier 1: 3 files, about 25 changed lines; one change, one commit attempt. In `accountChoiceStep`, the branch for "resumed while awaiting `do-account-choice`, no answer given" used to return `done`, silently taking the default signed-in folder. Now it returns `awaiting-person` with the account cards and a plain instruction. Origin: Justin, 2026-11-19, topic 143810: "it never asked me to choose a chatgpt account or login. This is a failure. It should NOT just assume and claim an account." (His run used an installer copy, 1.3.1875, that predates the account choice. This removes the remaining path by which any app could still get a silent claim.)
|
|
6
|
+
|
|
7
|
+
## Decision-point inventory
|
|
8
|
+
|
|
9
|
+
One install-flow branch: whether to proceed without the person's pick. It now never proceeds without one when accounts exist.
|
|
10
|
+
|
|
11
|
+
## 1. Over-block
|
|
12
|
+
|
|
13
|
+
An app from before 17 November resumes without an answer and stays at the step. It shows its generic waiting screen with the new instruction ("update the Instar app"). That person must update the app to finish, instead of getting the default account silently. This is intended: Justin ruled out the silent claim. A terminal-only person resuming without an answers file sees the same instruction. They can answer with `--answers` as before. Current Mac builds (95 and later) always write `account`.
|
|
14
|
+
|
|
15
|
+
## 2. Under-block
|
|
16
|
+
|
|
17
|
+
When no account is found, the step still finishes with `done` and goes to sign-in. That is correct, because there is nothing to choose. Whether the Mac's own Instar copy is up to date is the Mac app's job (it refreshes at each setup since build 111, with a 15-second limit). This change covers the case where that refresh fails.
|
|
18
|
+
|
|
19
|
+
## 3. Level-of-abstraction fit
|
|
20
|
+
|
|
21
|
+
The change sits in the single pure function that owns the choice. The caller in `install.ts` is unchanged.
|
|
22
|
+
|
|
23
|
+
## 4. Signal vs authority compliance
|
|
24
|
+
|
|
25
|
+
No detector or gate. A setup step now waits for the person instead of acting for them, which moves authority to the person.
|
|
26
|
+
|
|
27
|
+
## 5. Interactions
|
|
28
|
+
|
|
29
|
+
`door-sign-in` reads `accountConfigHome`. It now only runs after an explicit pick, a new-account answer, or when no account exists. The stale-pick branch is unchanged.
|
|
30
|
+
|
|
31
|
+
## 6. External surfaces
|
|
32
|
+
|
|
33
|
+
The instruction text shown at the waiting step is new. Nothing changes on the network or in the config.
|
|
34
|
+
|
|
35
|
+
## 6b. Operator-surface quality
|
|
36
|
+
|
|
37
|
+
The text is plain and says what to do next.
|
|
38
|
+
|
|
39
|
+
## 7. Multi-machine posture
|
|
40
|
+
|
|
41
|
+
`machine-local-justification: per-install-local-flow`. An install runs on one computer, against that computer's account folders.
|
|
42
|
+
|
|
43
|
+
## 8. Rollback cost
|
|
44
|
+
|
|
45
|
+
Revert the commit. No state carries over: install progress files keep the same shape.
|
|
46
|
+
|
|
47
|
+
## Conclusion
|
|
48
|
+
|
|
49
|
+
Safe and small. It removes a silent account claim.
|
|
50
|
+
|
|
51
|
+
## Second-pass review (if required)
|
|
52
|
+
|
|
53
|
+
Not required. No messaging, session-lifecycle, gate or sentinel authority is involved.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Side effects: home listener limits sized for a real phone, and a bounded refusal log
|
|
2
|
+
|
|
3
|
+
In plain words: the agent's home (same-network) listener now lets a phone open as many connections as a real app screen does, gives the Windows pass-through's single address the whole door where every phone arrives through it, and writes a short, bounded note of every refusal so a phone's 403 or connection error can be explained afterwards.
|
|
4
|
+
|
|
5
|
+
Tier 1 (a revert fully undoes it; no config, no migration, no new authority). Size: 3 source files (`src/server/sameNetworkListener.ts`, new `src/server/sameNetworkRefusals.ts`, `src/server/phoneSetupRoutes.ts` one read route), 1 awareness line, 1 dated note in the A4 spec, 2 new test files, 2 test files extended. Effort: one build pass, one commit attempt planned.
|
|
6
|
+
|
|
7
|
+
Why now: builder #62 paired a real iPhone app over home Wi-Fi with a Windows-made test agent. Messages never got through. Through the Windows pass-through 8 parallel TLS connections went 6/8, straight to the agent 8/8; the app log showed "refused (limit)" exactly in the phone's failure windows. The pass-through is fixed in the Windows app (24/240/64 per address, same numbers); this change makes the agent's own limits agree.
|
|
8
|
+
|
|
9
|
+
Also in this change (it blocks it): main's `tests/unit/no-silent-fallbacks.test.ts` fails (495 > baseline 494) since #3603 added a designed probe catch in `src/core/UpdateChecker.ts` `findBundledNpmCli` (`catch { /* not this layout */ }`, line 820). Bisected on a clean main worktree: 494 two commits back, 495 from #3603. That catch now carries the `@silent-fallback-ok` marker with its reason (comment only, no behaviour change); the count is 494 again.
|
|
10
|
+
|
|
11
|
+
## What changes for running agents
|
|
12
|
+
- `SAME_NETWORK_MAX_CONNECTIONS` 32 -> 64; `SAME_NETWORK_PER_ADDRESS_OPEN` 6 -> 24; `SAME_NETWORK_PER_ADDRESS_PER_MIN` 40 -> 240. Applies where the agent listens directly (macOS/Linux on the LAN address) and in WSL mirrored mode. WSL NAT mode is unchanged in shape: no per-address limit here (the pass-through owns it), the total is now 64, equal to the pass-through's total.
|
|
13
|
+
- WSL mirrored mode: the bind is loopback and every caller (the pass-through, carrying every phone) arrives as 127.0.0.1, so the old per-address bucket was one shared 6-place bucket for all phones (the spec itself noted "enough for one phone's setup"). That address (and its IPv4-mapped form) now gets `SAME_NETWORK_FORWARDER_OPEN` = 64 open and `SAME_NETWORK_FORWARDER_PER_MIN` = 960 a minute. Decided with the bind from the plan's mode, never from the caller. Any other address in mirrored mode keeps the per-phone limit. A direct (non-WSL) listener never gives loopback this bucket.
|
|
14
|
+
- New `SameNetworkRefusalLog`: records (a) a connection refused by a per-address limit (`address-open`, `address-per-minute`) or by the total (`total-open`, Node's `drop` event), (b) a failed TLS handshake (`tls-<code>`; a socket the listener itself closed for a limit is not recorded twice), (c) every request answered with status >= 400, by the gate or any route behind it, with the answer's own `error` code when it is a plain code (else `http-<status>`). Fields: time, kind, method, route (query dropped, id-like segments `:id`, odd characters `:x`, 120 chars max), status, first 8 characters of `X-Instar-Device` when it has an id's shape, caller's real address. Never a header value, body, query, signature, token, setup id or full device id. Bounded: 300 entries, an identical repeat of the newest only bumps its count; written as one JSON file (0600, atomic rename) at most once per 2 s and on stop; unreadable file starts empty; write errors keep entries in memory.
|
|
15
|
+
- `GET /mobile/same-network/refusals?limit=N` on the main listener, behind the existing `localOnly` (bearer + from this computer + no forwarding header + pairing on); not on the home listener (the gate only lets device-allowlisted routes through). Newest first, default 100, max 300.
|
|
16
|
+
- To read the answer's error code, the listener wraps `res.end` for that response only and keeps at most the first 512 characters of an error body in memory until the response finishes; nothing of it is stored except a matching plain code.
|
|
17
|
+
|
|
18
|
+
## 1. Over-block
|
|
19
|
+
Fewer refusals than before. Remaining over-block: a household where more than 64 connections are open at once through one door, or one device opening more than 240 a minute (four a second sustained). Neither matches normal phone use (ten screen loads a minute is 120).
|
|
20
|
+
|
|
21
|
+
## 2. Under-block
|
|
22
|
+
A misbehaving LAN device can now hold 24 sockets and open 4 a second instead of 6 and 40 a minute; the total 64, the 10 s handshake timeout and header/request timeouts still bound resources. In mirrored mode a local Windows program can use the whole 64 (it could already exhaust the old shared 6, starving every phone; a program already on the PC is outside the threat this limit addresses). The refusal log does not record successful requests (by design) nor refusals on the main listener.
|
|
23
|
+
|
|
24
|
+
Dependency named: the mirrored-mode door-sized bucket relies on the Windows pass-through limiting each real caller (24 open, 240 a minute). That is the Windows app's `LanForward` (instar-desktop-apps, commit raising its limits to 24/240/64, with tests on both sides of each limit in that repo); a Windows app older than that still refuses at 6/40 before the agent. How it is verified: the next live home-Wi-Fi phone run through the Windows app checks both hops with the refusal log and the app log.
|
|
25
|
+
|
|
26
|
+
## 3. Level of abstraction
|
|
27
|
+
The limits stay where A4 put them (the listener's connection handler and the pass-through). The log sits in the listener, the one place that sees connection-level, TLS-level and HTTP-level refusals of that listener; routes are unchanged. No smarter gate exists for this; the log feeds people and agents, not a gate.
|
|
28
|
+
|
|
29
|
+
## 4. Signal vs authority (docs/signal-vs-authority.md)
|
|
30
|
+
The log is a pure signal: it never refuses, delays or changes an answer. The limit change only moves existing numeric limits; the decision structure (deterministic resource bounds, not judgment calls) is unchanged, which is the right kind of logic for a resource bound.
|
|
31
|
+
|
|
32
|
+
## 5. Interactions
|
|
33
|
+
- `markSameNetworkSocket` rewrites the socket's `remoteAddress` to `sn:<addr>`; the log takes the real address from that function's return value, so `isLoopbackPeer` and arrival checks are untouched.
|
|
34
|
+
- Wrapping `res.end` calls the original with the same arguments; the gate's bare `/health` answer, `writeContinue` and express responses behave as before (existing integration/e2e suites pass).
|
|
35
|
+
- The Windows pass-through ships 24/240/64 in the same change set (separate repo), so the two hops agree; an older Windows app with 6/40/32 still refuses before the agent and is fixed by its own update.
|
|
36
|
+
- The wsl-listener test "per-address limit stays on in mirrored mode" now asserts the door-sized bucket.
|
|
37
|
+
|
|
38
|
+
## 6. External surfaces
|
|
39
|
+
One new local-only read route; a new state file in the agent's state folder (not synced). Phones see fewer refusals. No change to what the listener serves.
|
|
40
|
+
|
|
41
|
+
## 7. Multi-machine posture
|
|
42
|
+
Machine-local by design: each machine's home listener serves only phones on that machine's network, and its refusals are about that machine's door. The file is in `state/` and is not part of git-sync; reading another machine's refusals goes through that machine (not proxied), which matches the other `/mobile/same-network*` routes.
|
|
43
|
+
|
|
44
|
+
## 8. Rollback
|
|
45
|
+
Revert the commit. The state file is left behind harmlessly (nothing reads it after a revert); no migration.
|
|
46
|
+
|
|
47
|
+
## Tests
|
|
48
|
+
- `tests/unit/same-network-home-limits.test.ts` (new, 19): the literal numbers; a busy phone (ten 12-connection loads in a minute, then 24 open); 24/25 open and 240/241 a minute with the 59 s/60 s edges; mirrored loopback 64/65 and 960/961, IPv4-mapped form, two busy phones, another address still 24, a direct listener's loopback still 24; refusal-log route reduction, codes, device prefix, bound and coalescing, private file and restart, unreadable file; a real TLS listener records gate and route refusals (no secrets in the file), a limit refusal and a failed handshake once each. Negative control: with 6/40/32 put back, 9 of 19 fail (the limit tests; the log tests do not depend on the numbers).
|
|
49
|
+
- `tests/integration/same-network-refusals.test.ts` (new, 2): a stand-in phone over real TLS; refusals read back through the route without setup id, PIN, signature, pairing code or full device id; 401 without a token, 403 when forwarded.
|
|
50
|
+
- `tests/e2e/same-network-first-phone-alive.test.ts`: the route is alive on the production start path, and the log survives a restart.
|
|
51
|
+
- `tests/unit/same-network-wsl-listener.test.ts`: mirrored bucket assertion updated.
|
|
52
|
+
|
|
53
|
+
## Second-pass review
|
|
54
|
+
|
|
55
|
+
**Reviewer:** independent reviewer subagent (general-purpose, fresh context, given the diff, the artifact and the A4 spec), 2026-11-21. Verdict: concur, nothing blocking. It traced that the forwarder bucket is set only from a mirrored bind plan (always 127.0.0.1) and never in NAT, direct or test-override binds; that nothing secret is kept and a flood writes at most once per 2 s; that the `res.end` wrap passes everything through and records once; and that the route is reachable only with the bearer from this computer (the home listener's gate answers 404 first). Non-blocking findings, handled: an error body over 512 characters lost its code (a leading `"error"` field is now read without a full parse); a request whose connection closed before any answer went unrecorded (now `closed-before-answer`); the caller address cannot tell phones apart behind the pass-through and a flood can push old entries out (said in the awareness text); the pass-through dependency is named above. Accepted: a short all-letter token-like path segment would be kept as written (no current home-listener route carries one). Test gaps closed: NAT never gets the door-sized bucket, a burst writes the file once, a clipped error body keeps its code, a hung-up request is recorded.
|
|
56
|
+
|
|
57
|
+
## Current-main repair, 2026-11-22
|
|
58
|
+
|
|
59
|
+
Fresh helper-created worktree based on JKHeadley/main 9b61d6286, version 1.3.1978. The only merge conflict was two equivalent explanatory comments on UpdateChecker.findBundledNpmCli; retained current main verbatim. No runtime source differs from the previously reviewed candidate except the already-current main. All eight side-effects answers above remain unchanged. Targeted validation: 35 unit, 2 HTTP integration, and 3 production lifecycle tests pass; TypeScript noEmit passes. Full current-tree verification is required before merge. Independent reviewer /root/review_3625_repair concurred: listener, log, route and tests byte-for-byte unchanged from c3f9c466; local-only authentication and forwarder bounds intact. One repair review, one commit attempt planned.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Side-Effects Review — The minimum-build fence
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `identity-security-piece2c-minimum-build-fence`
|
|
4
|
+
**Date:** `2026-11-18`
|
|
5
|
+
**Author:** `Echo`
|
|
6
|
+
**Second-pass reviewer:** `independent reviewer subagent (see below)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Piece 2c of the approved identity and security design (topic 144636): machines too old to follow the identity rules are waited for before enrolment, then refused after it.
|
|
11
|
+
|
|
12
|
+
- `src/core/identityBuildFence.ts` contains:
|
|
13
|
+
- the per-level floor table (Basic has no fence);
|
|
14
|
+
- `PeerBuildLedger`: each peer's signed build statement, per registration, saved under the key-material path `state/owner-record/`, with four states (confirmed, below, unconfirmed, retired);
|
|
15
|
+
- `fenceInForce`: the record's `minimumBuild` or the last verified fence; a bad value never relaxes it; an owner's lowering to Basic clears it;
|
|
16
|
+
- `fenceStatus` (readiness) and `belowFence`.
|
|
17
|
+
- `ownerRecordSync.ts`:
|
|
18
|
+
- pulls carry `build` and `guards`, and replies carry the replier's build and guards, recorded before judging;
|
|
19
|
+
- after enrolment, only confirmed peers get or give owner-record data;
|
|
20
|
+
- one aggregated notice from the lease holder, at most daily;
|
|
21
|
+
- a `fence` section in status.
|
|
22
|
+
- `ownerRecordStore.gate()` holds with `fence-unusable` when enrolled with no usable fence.
|
|
23
|
+
- `machineRoutes.ts` (`POST /api/pair`) refuses a joiner below the fence after enrolment. The joiner (`commands/machine.ts`) now sends its build.
|
|
24
|
+
- `UpdateChecker.rollback()` refuses a rollback below the fence.
|
|
25
|
+
- `ownerRecordWiring.ts` adds `ownerRecordGate()` (piece 2b's one gate function, now exported for later pieces) and `ownerRecordFence()`, and wires the ledger, build and notice. `server.ts` passes the notice through `notify('SUMMARY', 'mesh-alert', …)`.
|
|
26
|
+
- The route `GET /owner-record` gains `fence`, and the awareness entry gains a line.
|
|
27
|
+
|
|
28
|
+
## Decision-point inventory
|
|
29
|
+
|
|
30
|
+
- **Sharing the owner record while enrolled:** confirmed peers only.
|
|
31
|
+
- **A join after enrolment:** refused below the fence.
|
|
32
|
+
- **A rollback after enrolment:** refused below the fence.
|
|
33
|
+
- **The gate:** holds when enrolled with no usable fence.
|
|
34
|
+
|
|
35
|
+
## 1. Over-block
|
|
36
|
+
|
|
37
|
+
- **Before enrolment nothing is refused,** and no agent is enrolled until piece 3.
|
|
38
|
+
- **After enrolment, missing evidence refuses nothing except the record itself.** A sleeping or restarting peer reads "unconfirmed": it gets no record entries until it pulls again, but liveness, lease and work traffic are untouched.
|
|
39
|
+
- **A join at or above the fence pairs normally.**
|
|
40
|
+
|
|
41
|
+
## 2. Under-block
|
|
42
|
+
|
|
43
|
+
A hand-installed older build still acts on its own direct inbound. That is the stated residual. Refusing it the lease and routing is piece 2d, and Phone-level enrolment waits for 2d.
|
|
44
|
+
|
|
45
|
+
## 3. Level-of-abstraction fit
|
|
46
|
+
|
|
47
|
+
- **The fence lives beside the owner record.**
|
|
48
|
+
- **Join and rollback refusals sit at their existing choke points:** the join route, and `UpdateChecker.rollback`, next to the existing Codex downgrade floor.
|
|
49
|
+
|
|
50
|
+
## 4. Signal vs authority compliance
|
|
51
|
+
|
|
52
|
+
**Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
|
|
53
|
+
|
|
54
|
+
- [ ] No — this change produces a signal consumed by an existing smart gate.
|
|
55
|
+
- [x] No — the decisions are deterministic comparisons over enumerable inputs (version strings, signed statements, enrolment state); no judgment over meaning.
|
|
56
|
+
- [ ] Yes — but the logic is a smart gate with full conversational context.
|
|
57
|
+
- [ ] ⚠️ Yes, with brittle logic — STOP.
|
|
58
|
+
|
|
59
|
+
## 4b. Judgment-point check
|
|
60
|
+
|
|
61
|
+
The 24-hour freshness window is four full backoff cycles of a pulling peer (spec §2). The notice is at most daily per unchanged list.
|
|
62
|
+
|
|
63
|
+
## 5. Interactions
|
|
64
|
+
|
|
65
|
+
- **Pulls gain two fields,** and older builds ignore unknown fields.
|
|
66
|
+
- **The join body gains `instarVersion`;** an older inviter ignores it.
|
|
67
|
+
- **Rollback** gains one more refusal, beside the existing Codex floor.
|
|
68
|
+
|
|
69
|
+
## 6. Rollback
|
|
70
|
+
|
|
71
|
+
Revert the commit. The ledger file can stay; nothing else reads it.
|
|
72
|
+
|
|
73
|
+
## 7. Evidence
|
|
74
|
+
|
|
75
|
+
- **Unit:** `tests/unit/identity-piece2c-build-fence.test.ts` covers:
|
|
76
|
+
- the ledger's states, ordering, restart and per-key observations;
|
|
77
|
+
- the fence in force, including a bad value and lowering;
|
|
78
|
+
- readiness;
|
|
79
|
+
- `belowFence`;
|
|
80
|
+
- sync refusal only after enrolment;
|
|
81
|
+
- the single notice and the status;
|
|
82
|
+
- rollback refusal.
|
|
83
|
+
- **Integration:** `tests/integration/identity-piece2c-join-fence.test.ts`, run by Local Verify, covers a join before enrolment, a refused join (no build and an older build), and an accepted join.
|
|
84
|
+
- **E2E lifecycle:** the 2b lifecycle file gains one case: the production sync sends its build in every pull, and the route reports `fence`.
|
|
85
|
+
|
|
86
|
+
## Second-pass review
|
|
87
|
+
|
|
88
|
+
An independent reviewer subagent read the code against the spec and probed it over three rounds. All 11 defects it found are fixed, each with a regression test:
|
|
89
|
+
- **Round 1 (8):**
|
|
90
|
+
- a lost or contested record relaxed or lowered the fence;
|
|
91
|
+
- unsigned reply builds counted as evidence, stamped with mixed clocks;
|
|
92
|
+
- the notice was filtered out by the hub;
|
|
93
|
+
- a new machine was reported as silent "for a day";
|
|
94
|
+
- this machine was left out of readiness;
|
|
95
|
+
- no report of a bad value;
|
|
96
|
+
- explicit installs were not fenced;
|
|
97
|
+
- the joiner hid the server's message.
|
|
98
|
+
- **Round 2 (2, plus 1 partial):**
|
|
99
|
+
- an unusable fence refused the owner's correction;
|
|
100
|
+
- a raise was never reported;
|
|
101
|
+
- a pairing-time judgement was still needed for new machines.
|
|
102
|
+
- **Round 3 (1):** a development install was compared against the installer's version instead of the agent's.
|
|
103
|
+
|
|
104
|
+
Round 4 concurred. Review: `.instar/state/identity-build-144636/reviews/p2c-second-pass.md` in the agent home.
|
|
105
|
+
|
|
106
|
+
E2E-PAIRING: EXEMPT — the join refusal is covered by the integration test over the real /api/pair route; no device pairing flow changes.
|
|
107
|
+
|
|
108
|
+
## Class-Closure Declaration
|
|
109
|
+
|
|
110
|
+
- **defectClass:** `unbounded-self-action`
|
|
111
|
+
- **closure:** `guard` (tests/unit/self-action-convergence.test.ts, entry owner-record-fence-notice)
|
|
112
|
+
- **reason:** the only self-triggered action is the aggregated notice: once per distinct list (never repeated for an unchanged one), from the lease holder only, closed when the list empties; registered in the self-action registry.
|
|
113
|
+
|
|
114
|
+
## Current-main merge repair, 2026-11-22
|
|
115
|
+
|
|
116
|
+
Tier 2 security maintenance under the existing approved spec; no new authority or policy. The normal merge from main 9b61d628656b5782e39c0ad57d6fb108b8ad3ad7 retains both new server imports. Semantic review found that the earlier merge had removed the unrelated stall-reconfirmation feature. Its source, types, tests, awareness and review artifacts are restored exactly from current main, including the server wiring. No paths are deleted relative to main. The minimum-build fence additions remain intact.
|
|
117
|
+
|
|
118
|
+
The independent parent reviewer inspected the actual candidate and concurred: the restored feature is byte-identical to main, and server initialization retains both the stall guard and fence wiring. No material merge concern remained, conditional on verification. Focused verification passed: 89 unit tests in five files, eight HTTP integration tests in two files, and TypeScript checking. Full verification remains assigned to the throughput coordinator. Dependency order 3445 then 3450 then 3453 and all queue holds remain unchanged.
|
|
119
|
+
|
|
120
|
+
The rollback is a normal revert of this merge repair, with the known cost that the prior branch accidentally omitted a main safety feature. There is no new persistence format, cross-machine behavior, external authority, or enrollment behavior in the repair. Existing signal-versus-authority analysis above continues to apply. One independent review pass and one commit attempt planned; no new design review rounds.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Side effects: no known owner means nobody's Telegram words teach (SEC-105)
|
|
2
|
+
|
|
3
|
+
## What changes for running agents
|
|
4
|
+
- An agent with a configured owner or a verified operator: no change (`learningOwnerId` returns that id first).
|
|
5
|
+
- An agent with no owner and exactly one allowed Telegram sender: no change (that sender is used as the owner).
|
|
6
|
+
- An agent with no owner and several allowed senders: Telegram messages stop feeding correction capture, learned preferences and the Jev correction shadow. That is the fix. These learners are signal-only, so nothing that already happened is undone, and no message is refused or delayed. The owner can restore learning by setting an owner or by becoming the verified operator.
|
|
7
|
+
- An agent with an open allowlist (no `authorizedUserIds`): the first verified sender becomes the verified operator, and so the verified owner (`everVerifiedOperatorUids`). From then on learning continues as before. Only messages that arrive before that first verification stop counting.
|
|
8
|
+
- The allowed list is compared as exact strings, the same way `TelegramAdapter.isAuthorized` compares, and duplicates count once. So `[5, "5"]` still names 5, while `" 5 "` or `"05"` names nobody.
|
|
9
|
+
- App messages: unchanged.
|
|
10
|
+
|
|
11
|
+
## Signal vs authority
|
|
12
|
+
The learners are signals. This narrows whose words feed them and gates nothing else. The owner-only rules elsewhere (Chief of Staff, approval buttons) already read `getVerifiedOwner()` and are untouched.
|
|
13
|
+
|
|
14
|
+
## Not changed here
|
|
15
|
+
- Skill learning (`SeamFilter` / `SkillLearningSentinel`) admits the topic's verified OPERATOR, not the owner. On a multi-sender agent, a non-owner bound as a topic's operator can still feed skill-learning PROPOSALS. A new skill stays pending until the owner's PIN-gated tap. This is reported back to the security ledger as a separate item.
|
|
16
|
+
- The Human-as-Detector link logs every user message as a guardian-miss signal, with no owner gate. That affects metrics only, never preferences.
|
|
17
|
+
|
|
18
|
+
## Rollback
|
|
19
|
+
Revert the commit. No stored data changes.
|
|
20
|
+
|
|
21
|
+
## Follow-up after Local Verify (2026-11-22)
|
|
22
|
+
The first full run (head 995242067, merged with main ecdfa223a) failed five end-to-end cases in `tests/e2e/jev-correction-shadow-lifecycle.test.ts`. Line 81 pinned the old wiring line (`telegram.getVerifiedOwner()`). The other cases built a `TelegramAdapter` with no owner and called `shadow.observe(entry)` with no owner id. Under this change that correctly means nobody's words count, so the shadow never checked anything. This is the fix working, not a defect. The fixtures now wire the owner the way `server.ts` does: the adapter allows one sender (4242, the sender of the test messages), and the fixture calls `observe(entry, adapter.getLearningOwner())`. The line-81 check now expects `getLearningOwner()`. Two new end-to-end cases prove the rule: with no allowed-sender list and no verified owner, and with two allowed senders, a development agent makes no check (`checks: 0`, no vendor call). `tests/integration/jev-correction-shadow-routes.test.ts` had the same owner-less fixture and got the same wiring before it could fail. No assertion was loosened and no product code changed. The branch was also brought up to date with main by a merge.
|
|
23
|
+
|
|
24
|
+
## Second follow-up (2026-11-22, targeted end-to-end run)
|
|
25
|
+
The lifecycle file's new "no owner known" case failed: it expected no vendor call and saw one. The cause was the test, not the product. The helper's last parameter defaulted to `[4242]`, and passing `undefined` explicitly takes the default in JavaScript, so that case ran with 4242 as the one allowed sender and a check correctly ran. The parameter now takes `null` for "no allowed-sender list", so the case really has no owner. No outside address was reached: the "vendor call" is the test's own mocked `fetchImpl`, which records the vendor URL it was given. The two-sender case was already correct. No assertion was changed.
|
|
26
|
+
|
|
27
|
+
## Second-pass review
|
|
28
|
+
**Reviewer:** independent second-pass subagent (fresh context, read-only). It found nothing blocking. Both learning callers are switched, every other `onMessageLogged` path was swept, and the owner-authority checks rightly stay on `getVerifiedOwner()`. All of its non-blocking notes were taken. The allowed-id match is now an exact string compare like `isAuthorized`, duplicates are removed, edge tests cover `0`, negative group ids, `" 5 "`, `"05"`, `[5, 5]` and `[5, "5"]`, and adapter tests cover owner precedence, a single sender, two senders and a second sender added at runtime. This document was corrected on the open allowlist and on scope.
|
|
29
|
+
|
|
30
|
+
**Follow-up review (2026-11-22): CONCUR.** A fresh Claude Sonnet subagent, read-only, traced every end-to-end and integration case by hand. It confirmed that the owner-less fixture was the root cause of all five failures. A bare adapter has no verified owner, and `authorizedUserIds` does not change how inbound messages are logged. Each case now passes for the right reason: the new no-owner and two-sender cases make no check. No assertion was loosened, the wiring matches `server.ts`, and no other test relies on "no owner means anyone".
|