instar 1.3.256 → 1.3.257

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.256",
3
+ "version": "1.3.257",
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",
@@ -147,8 +147,23 @@ if (latestPublished) {
147
147
 
148
148
  try {
149
149
  const { execSync } = await import('node:child_process');
150
- // Get files changed since the remote tracking branch
151
- const remoteBranch = execSync('git rev-parse --abbrev-ref @{u} 2>/dev/null || echo origin/main', { encoding: 'utf-8' }).trim();
150
+ // Compute "what this PR changes" against its MERGE TARGET (main), not the
151
+ // branch's own upstream (@{u}). Using @{u} breaks when a PR is updated by
152
+ // MERGING main in (the no-force-push path): `@{u}...HEAD` then includes all of
153
+ // main's already-shipped changes, producing false "src changed without a
154
+ // release-note fragment" errors (which forced INSTAR_PRE_PUSH_SKIP=1 on merge-
155
+ // updated PRs). A three-dot diff against main is the PR's TRUE diff in both the
156
+ // normal-incremental and merge-from-main cases, and never UNDER-reports the
157
+ // PR's own changes (merge-base of main and HEAD is the branch point).
158
+ const pickRef = (cands) => {
159
+ for (const r of cands) {
160
+ try { execSync(`git rev-parse --verify --quiet ${r}`, { stdio: 'pipe', encoding: 'utf-8' }); return r; }
161
+ catch { /* ref not present in this clone */ }
162
+ }
163
+ return null;
164
+ };
165
+ const remoteBranch = pickRef(['JKHeadley/main', 'origin/main', 'upstream/main', 'main'])
166
+ || execSync('git rev-parse --abbrev-ref @{u} 2>/dev/null || echo origin/main', { encoding: 'utf-8' }).trim();
152
167
  const changedFiles = execSync(`git diff --name-only ${remoteBranch}...HEAD 2>/dev/null || git diff --name-only HEAD~1 2>/dev/null`, { encoding: 'utf-8' })
153
168
  .trim()
154
169
  .split('\n')
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-05T00:14:24.582Z",
5
- "instarVersion": "1.3.256",
4
+ "generatedAt": "2026-06-05T00:23:37.925Z",
5
+ "instarVersion": "1.3.257",
6
6
  "entryCount": 198,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,32 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ `scripts/pre-push-gate.js` computed its "what files did this PR change" diff against `@{u}` (the
9
+ branch's own upstream). When a PR is updated by MERGING main in (the no-force-push path to resolve
10
+ conflicts), `@{u}...HEAD` then includes all of main's already-shipped files, so the gate's
11
+ src→fragment / src→tests / internal-only checks false-flag 173+ unrelated files and force
12
+ `INSTAR_PRE_PUSH_SKIP=1` (hit on #663, and complicated #766's re-trigger). The gate now diffs
13
+ against the PR's merge target (`JKHeadley/main`||`origin/main`||`upstream/main`||`main`), falling
14
+ back to `@{u}` only when no main ref resolves. A three-dot diff against main is the PR's true diff
15
+ in both the normal-incremental and merge-from-main cases and never under-reports the PR's changes.
16
+
17
+ ## What to Tell Your User
18
+
19
+ None — internal change (no user-facing surface).
20
+
21
+ ## Summary of New Capabilities
22
+
23
+ None — internal change (no user-facing surface).
24
+
25
+ ## Evidence
26
+
27
+ - Reproduced on #663 (merge-from-main → 173 false `src/` files → forced SKIP=1).
28
+ - Safe-by-construction: `main...HEAD` (merge-base = branch point) always contains all the PR's
29
+ commits, so it can never under-report; the only error direction is over-reporting (safe).
30
+ - 16 `tests/unit/pre-push-gate.test.ts` pass (incl. a new source-presence test for the main-ref
31
+ base); `node --check scripts/pre-push-gate.js` clean. Self-uses the internal-only lane (scripts +
32
+ test only, no `src/`).
@@ -0,0 +1,45 @@
1
+ # Side-Effects Review — pre-push gate diffs against the main ref, not @{u}
2
+
3
+ **Version / slug:** `prepush-gate-diff-base-main-ref`
4
+ **Date:** `2026-06-04`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required (build-gate diff base; safe-by-construction)`
7
+
8
+ ## Summary
9
+
10
+ `scripts/pre-push-gate.js` computed `changedFiles` via `git diff --name-only ${remoteBranch}...HEAD`
11
+ where `remoteBranch = @{u}` (the branch's OWN upstream). That breaks when a PR is updated by
12
+ MERGING main in (the no-force-push path used to resolve conflicts): `@{u}...HEAD` then includes
13
+ ALL of main's already-shipped changes, so the gate's section-3/3b checks see 173+ unrelated `src/`
14
+ files → false "src changed without a release-note fragment" errors, forcing `INSTAR_PRE_PUSH_SKIP=1`
15
+ (hit live on #663). The fix computes the diff against the PR's MERGE TARGET — the first resolvable
16
+ of `JKHeadley/main`/`origin/main`/`upstream/main`/`main` — falling back to the old `@{u}` behaviour
17
+ only when no main ref resolves.
18
+
19
+ ## 1. Over-block (what it still flags)
20
+
21
+ Unchanged for the normal incremental-push case: `main...HEAD` (three-dot, from the merge-base =
22
+ the branch point) == the PR's commits == what `@{u}...HEAD` gave for a never-merged-main branch.
23
+ The src→tests, src→fragment (#23), and internal-only (§3c) checks all still fire on the PR's real
24
+ `src/` changes. The "chore: release" commit (upgrades/ + version, no `src/`) still doesn't trip
25
+ section-3b, same as before.
26
+
27
+ ## 2. Under-block (what it now lets through)
28
+
29
+ Nothing it shouldn't. A three-dot diff against main can NEVER under-report the PR's own changes
30
+ (the merge-base of main and HEAD is the branch point, so all the PR's commits are in the diff). The
31
+ only direction it can err is OVER-reporting (if a branch is based off another branch, not main) —
32
+ the safe direction (extra false-positives, never a missed src-change-without-fragment). The fix
33
+ specifically REMOVES the merge-from-main false-positive without weakening any check.
34
+
35
+ ## 3. Blast radius
36
+
37
+ One file: `scripts/pre-push-gate.js` (the `changedFiles` computation feeding sections 3/3b/3c) +
38
+ its unit test. No `src/`, no runtime, no agent surface. `pickRef` is a local helper; on any error
39
+ it falls through to the prior `@{u}` logic, so a clone without a `main` remote behaves exactly as
40
+ before.
41
+
42
+ ## 4. Reversibility
43
+
44
+ Fully reversible: revert the one hunk. No state. Verified: `node --check` clean; 16 pre-push-gate
45
+ unit tests pass.