instar 1.3.358 → 1.3.360

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.
@@ -0,0 +1,11 @@
1
+ # Projects "merged" check now works on dev-agent homes too
2
+
3
+ Tonight's #866 fix wired the GitHub-PR verification into the projects pipeline's "building → merged" step — and it works: it resolves the PR, confirms it merged, gets the merge commit. But the very next check then failed on a dev-agent machine: the validator confirms the merge commit is actually on the main branch by checking "origin/main". On a normal install that's right. On a developer agent's home checkout, though, "origin" points at the agent's personal FORK, while the real merges land on the UPSTREAM repo under a differently-named remote. So origin/main never contains the commit, and every attempt to record a step as merged failed with "commit not reachable from origin/main" — even though the PR genuinely merged.
4
+
5
+ This is a sibling of the same class as #866: code that assumed the common-case environment and broke on the dev-agent's fork-origin layout. I hit it the moment #866's fix let me get that far — trying to mark this very initiative's own rounds merged.
6
+
7
+ The fix: instead of hardcoding "origin/main", the route now asks GitHub which repo it's actually talking to (the same repo the PR-view reads), finds the LOCAL remote whose URL points at that repo, and checks "<that-remote>/main". On a normal install that resolves right back to origin/main (unchanged behavior); on a fork-origin agent home it correctly resolves to the upstream remote where the merges live. Both lookups are read-only (a GitHub repo-view and a git remote listing).
8
+
9
+ With this, the projects pipeline can finally record merged steps on the machines we actually develop on — which is the whole point of being able to track an initiative through to "merged."
10
+
11
+ _Follow-up note: on any lookup error the resolver simply uses the standard default — by design, not as a failure._
@@ -0,0 +1,60 @@
1
+ # Side-effects review — Operator Binding agent-awareness CLAUDE.md section
2
+
3
+ ## What this change does
4
+ Adds the Agent Awareness Standard surface for the now-feature-complete Operator
5
+ Binding (Know Your Principal) loop (shipped across #904/#906/#908/#909/#910). It is
6
+ PURE DOCUMENTATION — a new CLAUDE.md capability section, no logic/behavior/data
7
+ change. Wired into all three required awareness surfaces so the parity gate stays
8
+ green:
9
+
10
+ - `src/scaffold/templates.ts` (`generateClaudeMd`): the `**Operator Binding (Know
11
+ Your Principal)**` section for NEW agents, inserted before the Commitments section.
12
+ - `src/core/PostUpdateMigrator.ts` (`migrateClaudeMd`): the SAME section for EXISTING
13
+ agents, appended only when absent (content-sniffed on `**Operator Binding (Know
14
+ Your Principal)**`), idempotent, with a `result.upgraded.push`.
15
+ - `src/core/PostUpdateMigrator.ts` (`migrateFrameworkShadowCapabilities` markers[]):
16
+ the `**Operator Binding (Know Your Principal)**` marker so Codex/Gemini agents
17
+ learn it too (no improvised weaker workaround).
18
+ - `tests/unit/feature-delivery-completeness.test.ts`: the `featureSections` entry
19
+ (the `**`-wrapped form, matching the migrator guard + markers like Session Boot
20
+ Self-Knowledge) so the three-surface parity is enforced going forward.
21
+
22
+ ## Blast radius
23
+ - **Additive, idempotent, no behavior change.** The migrator branch only appends
24
+ when the heading is absent; re-running migration is harmless. No config key, no
25
+ route, no class, no dependency.
26
+ - **Migration parity satisfied by construction** — this change exists BECAUSE of the
27
+ Migration Parity Standard: new agents (templates.ts) + existing agents (migrator)
28
+ + shadow frameworks (markers) all get the section. The parity gate
29
+ (feature-delivery-completeness) fails CI if any surface is missing — it passed
30
+ (77/77) after the `**`-wrapped featureSections fix (the auto-detect captures the
31
+ migrator's content-sniff string verbatim, so the tracked entry must match it
32
+ exactly — same precedent as `**Session Boot Self-Knowledge**`).
33
+
34
+ ## Content accuracy (verified against the merged feature)
35
+ - `/topic-operator`, `/topic-operator/:topicId`, `/topic-operator/session-context`
36
+ routes exist (merged #906). POST refuses a blank/unverifiable uid with 400 (#904
37
+ establishOperator). Auto-bind from authenticated sender on inbound (#909). The
38
+ observe-only guard writes `state/principal-coherence.jsonl` behind
39
+ `monitoring.principalCoherence.enabled`, signal-only (#910). The CLAUDE.md text
40
+ describes exactly these — no aspirational claims.
41
+
42
+ ## Framework generality
43
+ The documented capability is framework-agnostic (HTTP routes + an identity
44
+ disposition), which is why it carries a shadow marker. Codex/Gemini agents get the
45
+ same awareness; nothing here is Claude-specific.
46
+
47
+ ## Migration parity
48
+ This IS the migration-parity work. Covered: templates.ts (new), migrateClaudeMd
49
+ (existing), markers[] (shadow). No `.claude/settings.json`/hook/config changes.
50
+
51
+ ## Tests
52
+ - `tests/unit/feature-delivery-completeness.test.ts` — the three-surface parity gate,
53
+ 77/77 (the section is tracked in featureSections and present in templates.ts, the
54
+ migrator, and markers[]). Clean `tsc --noEmit`; lint clean; docs-coverage `--check`
55
+ passes (no new route); repo-invariants hold.
56
+
57
+ ## Rollback
58
+ Revert the templates.ts section, the migrator section + marker, and the
59
+ featureSections entry. The on-disk CLAUDE.md of already-migrated agents is inert
60
+ extra documentation; no data to unwind.
@@ -0,0 +1,53 @@
1
+ # Side-Effects Review — projects merge-base branch resolution (#866 sibling)
2
+
3
+ **Version / slug:** `projects-mergebranch-resolve`
4
+ **Date:** `2026-06-06`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required — small read-only environment fix + unit coverage`
7
+
8
+ ## Summary of the change
9
+
10
+ After #866 wired ghPrView, the `building → merged` gate's NEXT check —
11
+ `gitMergeBaseIsAncestor(oid, 'origin/main')` — failed on fork-origin dev-agent
12
+ homes: `origin` is the agent's fork (instar-echo) while merges land on the
13
+ upstream remote (JKHeadley/instar), so origin/main never contains the merge
14
+ commit (MERGE_COMMIT_UNREACHABLE). Fix: `StageTransitionValidator` reads the
15
+ branch from a new `ctx.mergeBaseBranch` (default `origin/main`, behavior
16
+ preserved); the route computes it via `resolveCanonicalMainRef()` — asks gh
17
+ which repo it resolves for the cwd, maps that to the local remote whose URL
18
+ matches, returns `<remote>/main`, falling back to `origin/main`.
19
+
20
+ ## Decision-point inventory
21
+ - `building → merged` merge-base check — was hardcoded `origin/main`, now uses the resolved canonical-main ref. The check's logic is unchanged; only the ref it compares against is now environment-correct.
22
+
23
+ ## 1. Over-block
24
+ Before: fork-origin homes 100% over-blocked (every merged transition rejected though the PR merged). After: rejects only when the commit truly isn't on the canonical main. Strict improvement. Canonical-origin installs unchanged (resolves to origin/main).
25
+
26
+ ## 2. Under-block
27
+ If gh/remote resolution misfires it falls back to `origin/main` (the prior behavior) — never a more-permissive ref, so no new under-block. The resolved remote must actually contain the commit or the gate still rejects.
28
+
29
+ ## 3. Level-of-abstraction fit
30
+ Validator stays pure (takes the branch as input); the environment resolution lives in the route (where gh/git + cwd are). Right seam — mirrors how #866 injected the helpers.
31
+
32
+ ## 4. Signal vs authority compliance
33
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
34
+ - [x] No — the gate remains a real check (commit reachability on canonical main); this only supplies the correct ref.
35
+
36
+ ## 5. Interactions
37
+ - `resolveCanonicalMainRef` is read-only: `gh repo view` (gh, not funnel-gated) + `git remote -v` via SafeGitExecutor.readSync (`remote` is a READONLY_GIT_VERB, shape-checked list/get-url only).
38
+ - Any failure → fallback `origin/main`; never throws into the route.
39
+ - No interaction with the other advance edges (outline→spec, etc.) — only the merged edge reads mergeBaseBranch.
40
+
41
+ ## 6. External surfaces
42
+ - Spawns `gh repo view` + `git remote -v` against the project target repo when a merged transition is attempted. No persistent state, no messaging, no fleet surface.
43
+
44
+ ## 7. Rollback cost
45
+ Pure code revert + patch. No state.
46
+
47
+ ## Conclusion
48
+ Completes the #866 chain: the projects pipeline can now record merged steps on dev-agent homes (fork-origin) as well as canonical-origin installs. Clear to ship.
49
+
50
+ ## Evidence pointers
51
+ - `tests/unit/StageTransitionValidator.test.ts` — new cases: helper called with the configured `mergeBaseBranch` (not origin/main); unreachable error names the configured branch. 28 validator tests + 45 projects-api green; tsc + destructive-lint clean.
52
+
53
+ _Follow-up: the resolver catch carries an `@silent-fallback-ok` note — falling back to the `origin/main` default is the conservative behavior this resolver refines, not a swallowed error._