instar 1.3.1979 → 1.3.1980

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.1979",
3
+ "version": "1.3.1980",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-11-23T02:02:59.257Z",
5
- "instarVersion": "1.3.1979",
4
+ "generatedAt": "2026-11-23T06:17:42.373Z",
5
+ "instarVersion": "1.3.1980",
6
6
  "entryCount": 210,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "generatedFrom": "source-tree",
4
4
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
5
- "packageVersion": "1.3.1979",
5
+ "packageVersion": "1.3.1980",
6
6
  "guards": [
7
7
  {
8
8
  "ref": "docs/audits/phase-b/f10-triage.md",
@@ -1,5 +1,5 @@
1
1
  {
2
- "sha256": "07f26873a3240d0e8b1fbfc44acfdf43e7e16f05127f1cda46bbaeb28ee815d0",
2
+ "sha256": "f286225fad69021747c3c3c21be6b436a6a481fa98213913cdc4a55d0585cd0d",
3
3
  "registrySha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
4
- "packageVersion": "1.3.1979"
4
+ "packageVersion": "1.3.1980"
5
5
  }
@@ -2,5 +2,5 @@
2
2
  "sha256": "11e2a45ab1345e2ded6499404ee9962e4e48bcfed4677a4d31dac4492565d2fa",
3
3
  "articleCount": 102,
4
4
  "generatedFrom": "docs/STANDARDS-REGISTRY.md",
5
- "packageVersion": "1.3.1979"
5
+ "packageVersion": "1.3.1980"
6
6
  }
@@ -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,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,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".