instar 0.28.125 → 1.0.8

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": "0.28.125",
3
+ "version": "1.0.8",
4
4
  "description": "Persistent autonomy infrastructure for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * resolve-publish-version — reconcile package.json (operator authority) with
4
+ * the npm registry (shipped truth) and print the version the release workflow
5
+ * should publish.
6
+ *
7
+ * Added 2026-05-19 after the v1.0.0 deployment misalignment incident
8
+ * (docs/incidents/2026-05-19-v1-deployment-misalignment.md). The old workflow
9
+ * always derived the next version from npm and ignored package.json, which
10
+ * made an operator-intended major bump structurally impossible. That is the
11
+ * exact failure this script closes.
12
+ *
13
+ * Policy:
14
+ * LOCAL > NPM → publish at LOCAL (operator-intended leap: major/minor/
15
+ * explicit-patch jump). This is how a v1.0.0 cut happens.
16
+ * LOCAL == NPM → routine patch: NPM with patch+1. The common case — a PR
17
+ * that does not touch package.json leaves LOCAL equal to the
18
+ * last released version.
19
+ * LOCAL < NPM → stale package.json (a queued run that landed after an
20
+ * earlier publish already bumped). Never downgrade — NPM
21
+ * with patch+1.
22
+ *
23
+ * Usage:
24
+ * node scripts/resolve-publish-version.mjs <localVersion> <npmVersion>
25
+ * → prints the resolved version to stdout, nothing else.
26
+ *
27
+ * Exported as a function for unit testing.
28
+ */
29
+
30
+ /**
31
+ * @param {string} a semver "x.y.z"
32
+ * @param {string} b semver "x.y.z"
33
+ * @returns {"gt"|"eq"|"lt"} a compared to b
34
+ */
35
+ export function compareSemver(a, b) {
36
+ const pa = String(a).split('.').map(Number);
37
+ const pb = String(b).split('.').map(Number);
38
+ for (let i = 0; i < 3; i++) {
39
+ const x = pa[i] || 0;
40
+ const y = pb[i] || 0;
41
+ if (x > y) return 'gt';
42
+ if (x < y) return 'lt';
43
+ }
44
+ return 'eq';
45
+ }
46
+
47
+ /**
48
+ * @param {string} localVersion package.json version
49
+ * @param {string} npmVersion `npm view instar version` (or "0.0.0" if unpublished)
50
+ * @returns {{version: string, reason: "operator-intended"|"routine-patch"}}
51
+ */
52
+ export function resolvePublishVersion(localVersion, npmVersion) {
53
+ const cmp = compareSemver(localVersion, npmVersion);
54
+ if (cmp === 'gt') {
55
+ return { version: localVersion, reason: 'operator-intended' };
56
+ }
57
+ const [major, minor, patch] = String(npmVersion).split('.').map(Number);
58
+ return {
59
+ version: `${major || 0}.${minor || 0}.${(patch || 0) + 1}`,
60
+ reason: 'routine-patch',
61
+ };
62
+ }
63
+
64
+ // CLI entrypoint — only runs when invoked directly, not when imported.
65
+ if (import.meta.url === `file://${process.argv[1]}`) {
66
+ const [, , localVersion, npmVersion] = process.argv;
67
+ if (!localVersion || !npmVersion) {
68
+ console.error('usage: resolve-publish-version.mjs <localVersion> <npmVersion>');
69
+ process.exit(2);
70
+ }
71
+ const { version } = resolvePublishVersion(localVersion, npmVersion);
72
+ process.stdout.write(version);
73
+ }
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-05-19T17:35:42.321Z",
5
- "instarVersion": "0.28.125",
4
+ "generatedAt": "2026-05-19T19:32:42.283Z",
5
+ "instarVersion": "1.0.8",
6
6
  "entryCount": 189,
7
7
  "entries": {
8
8
  "hook:session-start": {
package/upgrades/1.0.8.md CHANGED
@@ -1,40 +1,93 @@
1
- # Upgrade Guide — v1.0.8
1
+ # Upgrade Guide — v1.0.8 (the v1.0 milestone)
2
2
 
3
3
  <!-- bump: patch -->
4
4
 
5
5
  ## What Changed
6
6
 
7
- Restores Migration Parity §4 conformance for canonical (built-in) hooks. The Hook primitive shipped in PR #253 with a stamp-and-refuse-on-conflict pattern that resurrected the install-if-missing wedge §4 was written to prevent. This release inverts the policy so that built-in hooks are once again always overwritten on every migration run.
8
-
9
- Three small code changes:
10
-
11
- - The ParityRule interface gained an optional alwaysOverwrite field.
12
- - hookParityRule sets alwaysOverwrite to true.
13
- - FrameworkParitySentinel honors alwaysOverwrite and emits a new parity:user-edit-overwritten audit event when overwriting a user-edited rendering.
14
-
15
- The user-edit detection stays as a signal in verify output; only the blocking authority moves from the rule to the higher-context Migration Parity policy. skillParityRule does NOT opt in because Migration Parity §5 explicitly carves out skills as refuse-on-conflict with PostUpdateMigrator override.
7
+ This is the official v1.0 milestone release. Two things land together because
8
+ they are causally linked:
9
+
10
+ 1. **Versioning is now truthful.** The release workflow honors the version in
11
+ `package.json` as the operator's authority for an intended release. It used
12
+ to derive the next version solely from the npm registry and ignore
13
+ `package.json`, which made a deliberate major/minor release structurally
14
+ impossible. That gap is the documented root cause of the 2026-05-19
15
+ deployment misalignment, where v1.0 framework-parity work shipped to npm
16
+ under v0.28.x patch numbers. The release that makes truthful versioning
17
+ possible is, fittingly, the release that stamps v1.0.
18
+
19
+ 2. **The v1.0 milestone is the framework-portability architecture.** Instar is
20
+ no longer tied to Claude Code as a runtime. The eleven Layer-3 primitives
21
+ (skill, hook, agent, tool, memory, instruction-file, session-resume,
22
+ slash-command, outbound-relay, conversational-action, MCP-server) are
23
+ abstracted behind a parity-rule registry. Identity renders per framework
24
+ (Claude Code, Codex, Gemini) from a single canonical source. Session-launch
25
+ builders, the intelligence-provider factory, and the post-update migrator
26
+ are all framework-aware.
27
+
28
+ The version-resolution policy was extracted from inline workflow scripting
29
+ into `scripts/resolve-publish-version.mjs` so it is unit-tested.
16
30
 
17
31
  ## Evidence
18
32
 
19
- Reproduction prior to this release: render a canonical hook to .claude/hooks/session-start/inject.sh, append a user edit (e.g. echo "user added"), then run the parity scan. The verify pass reports user-edit-conflict, and the sentinel skips remediation. On the next instar update where the canonical hook source changes (the typical fix-broken-template scenario), the agent stays stuck on the user-edited stale rendering.
33
+ Reproduction prior to this change: set `package.json` to a higher version
34
+ while npm is behind, merge to main. The workflow published the npm-derived
35
+ patch and silently discarded the intended version. This is the documented
36
+ root cause in `docs/incidents/2026-05-19-v1-deployment-misalignment.md`.
20
37
 
21
- Observed after this release: same setup, same parity scan, the sentinel now calls remediate, the rendering is overwritten with the new canonical body, and the operator sees parity:user-edit-overwritten in the audit stream. Recovery of the user edit is available via git history if needed.
38
+ Observed after this change: a higher `package.json` version than npm publishes
39
+ at the intended version (this is how v1.0.8 itself ships). A routine PR that
40
+ does not touch `package.json` still resolves to the next patch. A stale lower
41
+ `package.json` resolves to npm patch-plus-one, never a downgrade.
22
42
 
23
- Unit-test verification: tests/unit/providers/parity/hookParityRule.test.ts now asserts remediate ALWAYS OVERWRITES user-edits per Migration Parity §4. tests/unit/monitoring/FrameworkParitySentinel.test.ts asserts the new audit event fires for alwaysOverwrite rules.
43
+ Unit verification: `tests/unit/resolve-publish-version.test.ts` — nine cases
44
+ covering greater-than, equal, and less-than across each semver field,
45
+ operator-intended major and minor bumps, routine patch, stale no-downgrade,
46
+ unpublished-package, and a regression replaying the exact 2026-05-19 incident
47
+ input and asserting it now resolves to the intended version.
24
48
 
25
49
  ## What to Tell Your User
26
50
 
27
- - "When Instar ships a built-in hook, the canonical version always wins on the next update. A subtle regression in the Hook primitive was making us refuse to overwrite hooks that anyone had edited locally — which is exactly the pattern that left us stuck on a broken template once before. This release puts the always-overwrite policy back in place, and adds an audit signal so any clobbered edit is visible and recoverable from git."
51
+ - "Instar v1.0 is here. The headline is portability: your agent is no longer locked to one runtime. The same agent identity, skills, hooks, and memory now render correctly whether the runtime is Claude Code, Codex, or another supported framework. This release also fixes the versioning process so the published version always matches what we intend to ship."
52
+ - "If you are updating an existing agent, there is nothing you need to do. The framework-portability code already reached you through earlier patch updates; this release stamps the milestone and corrects the version number. Six narrow hardening improvements ship as quick follow-up patches over the next few releases."
28
53
 
29
54
  ## Summary of New Capabilities
30
55
 
31
56
  | Capability | How to Use |
32
57
  |-----------|-----------|
33
- | ParityRule alwaysOverwrite field | Set alwaysOverwrite to true on rules covered by Migration Parity §4. Defaults to false (refuse-on-conflict for §5 rules like skills). |
34
- | parity:user-edit-overwritten audit event | Sentinel emits this whenever an alwaysOverwrite rule clobbers a user-edited rendering. Listen via FrameworkParitySentinel events. |
35
- | Canonical hook always-overwrite restored | No action required; built-in hooks are now once again always overwritten on every migration cycle. Custom hooks in .claude/hooks/custom/ continue to be untouched. |
58
+ | Truthful versioning | Automatic. The release workflow honors the intended version. Routine patches are unchanged. |
59
+ | Framework portability | Automatic. Agent identity and the eleven primitives render per runtime from a single canonical source. |
60
+ | Per-framework identity | Canonical identity lives in one place; the runtime-specific shadow file is regenerated on demand. |
61
+
62
+ ## Agent Migration Notes
63
+
64
+ For an agent updating from any v0.28.x to v1.0.8:
65
+
66
+ - **Required actions: none.** The framework-portability code shipped
67
+ incrementally under v0.28.122–v0.28.125. This release stamps the milestone
68
+ and corrects the version label. No canonical-file migration is required.
69
+ - **What is new on disk after update:** the post-update migrator continues to
70
+ refresh framework-rendered copies of canonical primitives. The
71
+ conversational-action catalog is reachable through its on-demand loaders
72
+ (context segment, knowledge-tree probe, playbook item). No always-loaded
73
+ identity-prompt growth.
74
+ - **Verification an agent can run on itself:** confirm the installed version
75
+ reads 1.0.8 or higher; confirm the canonical identity file is the source of
76
+ truth and the runtime shadow carries the auto-generated banner.
77
+ - **If an agent runs a non-Claude-Code runtime:** six narrow portability gaps
78
+ (documented in the v1.0.0 cross-framework audit) ship as v1.0.9–v1.0.14
79
+ patches immediately after this release. Until then, dual-framework installs
80
+ are unaffected; the gaps only touch single-runtime non-Claude-Code installs.
36
81
 
37
82
  ## Deferred (Tracked Follow-ups)
38
83
 
39
- - Wire parity:user-edit-overwritten into a Dashboard view so operators see clobber events without grepping logs.
40
- - Audit the remaining merged primitive PRs (#254 Agent/Tool/Memory and #255 Sentinel ship-order) using the lessons-aware reviewer; corrective amendments per finding.
84
+ - Six audit-flagged portability hardening gaps ship as v1.0.9–v1.0.14 patches:
85
+ init routing through the identity renderer, framework-aware connector-server
86
+ registration, a framework-session-store abstraction, neutral relay-script
87
+ path, post-update-migrator framework guards, and migrator/identity-renderer
88
+ unification. Each has a documented fix from the cross-framework audit.
89
+ - The broader deployment-lockdown infrastructure (release-tier config,
90
+ multi-signature for major bumps, major-work branch isolation, hold-signal,
91
+ incident-memory injection) is designed separately and tracked in the
92
+ deployment-lockdown topic. This release is only the version-truth
93
+ prerequisite plus the milestone stamp.
@@ -0,0 +1,68 @@
1
+ # Side-effects review — Publish version-truth
2
+
3
+ Per L6. Seven dimensions.
4
+
5
+ ## 1. Over-block / under-block
6
+
7
+ **Before.** UNDER: the workflow could not express an operator-intended major
8
+ bump at all — every release was a patch. This is the incident root cause.
9
+
10
+ **After.** No over-block. Routine patch PRs (the overwhelming majority, which
11
+ don't touch package.json) behave identically — LOCAL == NPM → patch+1. The
12
+ only new path is "LOCAL > NPM → honor LOCAL," which is exactly the
13
+ intentional-leap case. The LOCAL < NPM guard prevents an accidental downgrade
14
+ (a queued-run stale-package scenario), so there's no new under-block either.
15
+
16
+ ## 2. Level-of-abstraction fit
17
+
18
+ The resolution policy lives in `scripts/resolve-publish-version.mjs` — a pure
19
+ function with a CLI shim, unit-tested. The workflow calls it. This is the
20
+ right altitude: decision logic in testable code, orchestration in the
21
+ workflow. No logic buried in inline bash.
22
+
23
+ ## 3. Signal vs Authority compliance
24
+
25
+ package.json is the SIGNAL of operator intent. The npm registry is the
26
+ AUTHORITY for what shipped. The script reconciles them deterministically with
27
+ a documented precedence. No brittle filter is granted blocking authority; the
28
+ script never *blocks* a publish, it only *resolves the number*. (The loud
29
+ refusal-on-mismatch behavior is part of the separate lockdown spec, not this
30
+ PR.)
31
+
32
+ ## 4. Interactions with adjacent systems
33
+
34
+ - **Release workflow.** Only the "Determine next version" step changes. The
35
+ NEXT.md skip-gate, the guide-check, the publish, and the tag/commit steps
36
+ are untouched.
37
+ - **Routine patch line.** Unchanged. Verified by the `eq` test case.
38
+ - **Queued concurrent runs.** The original concern ("queued runs leave
39
+ package.json out of sync") is preserved: a queued run that lands after an
40
+ earlier publish bumped will see LOCAL <= NPM and patch-bump cleanly, not
41
+ collide.
42
+ - **The v1.0.0 cut.** This is the enabling change — the alignment PR will set
43
+ package.json to 1.0.0 and the workflow will, for the first time, honor it.
44
+
45
+ ## 5. Rollback cost
46
+
47
+ Low. Three files (workflow step, new script, new test). `git revert` restores
48
+ the npm-derived behavior. No state migration, no deployed-agent impact (this
49
+ is build-time infra, not shipped runtime code).
50
+
51
+ ## 6. Backwards compatibility / drift surface
52
+
53
+ Fully backwards-compatible for the patch line. The only behavioral delta is
54
+ the previously-impossible major/minor leap. No config, no schema, no agent
55
+ files touched. Drift surface: none — the script has no persistent state.
56
+
57
+ ## 7. Authorization / Trust posture
58
+
59
+ No new authority. The script reads two version strings and prints one. It
60
+ cannot publish, cannot mutate state, cannot escalate. The actual publish
61
+ authority (NPM_TOKEN) is unchanged and still gated by the same CI required
62
+ checks via branch protection.
63
+
64
+ ## Outcome
65
+
66
+ Ship. Minimal, incident-driven, fully tested, no over-block, trivial
67
+ rollback. Unblocks the v1.0.0 cut without pulling in the broader lockdown
68
+ scope.