instar 1.3.1049 → 1.3.1050
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/data/standards-registry.meta.json +1 -1
- package/package.json +1 -1
- package/scripts/instar-dev-precommit.js +12 -3
- package/src/data/builtin-manifest.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/upgrades/1.3.1050.md +25 -0
- package/upgrades/decision-audit-scope.eli16.md +23 -0
- package/upgrades/side-effects/decision-audit-scope.md +73 -0
package/package.json
CHANGED
|
@@ -252,14 +252,14 @@ if (bootstrapTrigger) {
|
|
|
252
252
|
|
|
253
253
|
let tierSignal = { suggestedTier: 2, sizeTier: 2, riskFloor: 1, reasons: [] };
|
|
254
254
|
let totalChangedLoc = 0;
|
|
255
|
+
let addedLines = 0;
|
|
256
|
+
let deletedLines = 0;
|
|
255
257
|
// Hoisted to module scope (docs/specs/self-action-convergence.md → E3 impl
|
|
256
258
|
// note): addedDiffText is computed in the Step-3.5 block but consumed later by
|
|
257
259
|
// assertSelfActionDeclared at BOTH the enforceTier1 and Tier-2 pass-through call
|
|
258
260
|
// sites. It must outlive the block.
|
|
259
261
|
let addedDiffText = '';
|
|
260
262
|
{
|
|
261
|
-
let addedLines = 0;
|
|
262
|
-
let deletedLines = 0;
|
|
263
263
|
try {
|
|
264
264
|
const numstat = execSync(
|
|
265
265
|
`git diff --cached --numstat -- ${inScopeFiles.map((f) => JSON.stringify(f)).join(' ')}`,
|
|
@@ -441,6 +441,9 @@ const decisionEntryPath = writeDecisionAudit({
|
|
|
441
441
|
belowFloor,
|
|
442
442
|
files: inScopeFiles.length,
|
|
443
443
|
loc: totalChangedLoc,
|
|
444
|
+
scopeFiles: inScopeFiles,
|
|
445
|
+
addedLines,
|
|
446
|
+
deletedLines,
|
|
444
447
|
causalAutopsy,
|
|
445
448
|
classClosure: (freshestTrace && typeof freshestTrace.classClosure === 'object' && freshestTrace.classClosure) || null,
|
|
446
449
|
});
|
|
@@ -1356,7 +1359,7 @@ function blockCommit(files, reason) {
|
|
|
1356
1359
|
// fire, the line just evaporated with the worktree). If the commit is later
|
|
1357
1360
|
// blocked by the gate, the staged line simply rides the retry commit — both
|
|
1358
1361
|
// lines describe real gate evaluations.
|
|
1359
|
-
function writeDecisionAudit({ slug, suggestedTier, declaredTier, riskFloor, riskFloorReasons, belowFloor, files, loc, causalAutopsy = null, classClosure = null }) {
|
|
1362
|
+
function writeDecisionAudit({ slug, suggestedTier, declaredTier, riskFloor, riskFloorReasons, belowFloor, files, loc, scopeFiles, addedLines, deletedLines, causalAutopsy = null, classClosure = null }) {
|
|
1360
1363
|
try {
|
|
1361
1364
|
fs.mkdirSync(DECISIONS_DIR, { recursive: true });
|
|
1362
1365
|
const ts = new Date().toISOString();
|
|
@@ -1382,6 +1385,12 @@ function writeDecisionAudit({ slug, suggestedTier, declaredTier, riskFloor, risk
|
|
|
1382
1385
|
belowFloor,
|
|
1383
1386
|
files,
|
|
1384
1387
|
loc,
|
|
1388
|
+
scope: {
|
|
1389
|
+
basis: 'staged-in-scope-additions-plus-deletions',
|
|
1390
|
+
files: scopeFiles,
|
|
1391
|
+
addedLines,
|
|
1392
|
+
deletedLines,
|
|
1393
|
+
},
|
|
1385
1394
|
// Causal autopsy (directive 2026-06-05): what caused the issue this
|
|
1386
1395
|
// commit fixes — prior-pr / environment-shift / new-code / latent /
|
|
1387
1396
|
// unknown, with linked PRs. null = not declared (advisory in slice 1).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-07-29T10:
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-07-29T10:34:17.724Z",
|
|
5
|
+
"instarVersion": "1.3.1050",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Development decision records now retain the exact staged source files and
|
|
9
|
+
added/deleted-line counts behind their compact file and line totals.
|
|
10
|
+
|
|
11
|
+
## What to Tell Your User
|
|
12
|
+
|
|
13
|
+
Internal development audit records now explain exactly what their size
|
|
14
|
+
counters measured.
|
|
15
|
+
|
|
16
|
+
## Summary of New Capabilities
|
|
17
|
+
|
|
18
|
+
- Self-describing scope evidence for development decisions.
|
|
19
|
+
|
|
20
|
+
## Evidence
|
|
21
|
+
|
|
22
|
+
- The focused hook integration test verifies the persisted counting basis,
|
|
23
|
+
file list, additions, and deletions.
|
|
24
|
+
- Existing compact `files` and `loc` fields remain unchanged for compatible
|
|
25
|
+
readers.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Decision records now explain what their counters measured
|
|
2
|
+
|
|
3
|
+
The development commit gate already records two compact numbers for each
|
|
4
|
+
reviewed source change: how many source files were in scope and how many lines
|
|
5
|
+
changed. Those numbers are useful, but the record did not retain the concrete
|
|
6
|
+
file list or say whether the line count represented additions, deletions, or a
|
|
7
|
+
different basis. A later reader could see “three files, eighteen lines” without
|
|
8
|
+
being able to tell which files produced that result.
|
|
9
|
+
|
|
10
|
+
The gate now stores an additional `scope` object beside the existing counters.
|
|
11
|
+
It names the counting basis, lists the exact staged source files included, and
|
|
12
|
+
records added and deleted lines separately. The old `files` and `loc` fields
|
|
13
|
+
remain unchanged, so existing readers continue to work.
|
|
14
|
+
|
|
15
|
+
The new values come from the same staged-diff calculation the gate already
|
|
16
|
+
uses for tier signaling. There is no second calculation that can disagree with
|
|
17
|
+
the original counters. If that existing calculation cannot run, the gate keeps
|
|
18
|
+
its current fail-open behavior and records the same zero counts explicitly.
|
|
19
|
+
|
|
20
|
+
This changes evidence only. It does not change which files require review,
|
|
21
|
+
which tier is suggested, which trace is selected, or whether a commit passes.
|
|
22
|
+
A focused integration test runs the real hook in a temporary repository and
|
|
23
|
+
asserts the emitted record’s basis, file list, additions, and deletions.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Side-Effects Review — development decision audit scope
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `decision-audit-scope`
|
|
4
|
+
**Date:** 2026-07-29
|
|
5
|
+
**Author:** Instar Agent (instar-codey)
|
|
6
|
+
|
|
7
|
+
## Summary
|
|
8
|
+
|
|
9
|
+
The development pre-commit gate now persists the exact in-scope staged file
|
|
10
|
+
list, added-line count, deleted-line count, and named counting basis beside
|
|
11
|
+
each decision record’s existing compact `files` and `loc` counters.
|
|
12
|
+
|
|
13
|
+
## Decision-point inventory
|
|
14
|
+
|
|
15
|
+
This changes evidence emitted by an existing gate, not its authority. Tier
|
|
16
|
+
classification, trace selection, refusal conditions, and verdict finalization
|
|
17
|
+
remain unchanged.
|
|
18
|
+
|
|
19
|
+
## 1. Over-block
|
|
20
|
+
|
|
21
|
+
No new refusal is introduced. Audit writing remains best-effort and fail-open,
|
|
22
|
+
as before. The additive fields cannot prevent a commit.
|
|
23
|
+
|
|
24
|
+
## 2. Under-block
|
|
25
|
+
|
|
26
|
+
The record still reflects only files covered by the gate’s existing `inScope`
|
|
27
|
+
predicate, not every file in the pull request. That boundary is now explicit
|
|
28
|
+
in the `staged-in-scope-additions-plus-deletions` basis and concrete file list,
|
|
29
|
+
rather than hidden behind a compact count. Removing the emitted object made the
|
|
30
|
+
focused assertion fail before the implementation was restored, proving the
|
|
31
|
+
test does not merely restate its own derivation.
|
|
32
|
+
|
|
33
|
+
## 3. Level-of-abstraction fit
|
|
34
|
+
|
|
35
|
+
The audit writer is the correct owner because it already receives the tier
|
|
36
|
+
signal and writes the durable decision record. The added values reuse the
|
|
37
|
+
same staged `numstat` calculation rather than asking downstream consumers to
|
|
38
|
+
reconstruct a vanished diff.
|
|
39
|
+
|
|
40
|
+
## 4. Signal vs authority compliance
|
|
41
|
+
|
|
42
|
+
Compliant with `docs/signal-vs-authority.md`. The scope fields are evidence
|
|
43
|
+
only. They add no detector, filter, or blocking authority and do not alter the
|
|
44
|
+
gate’s verdict.
|
|
45
|
+
|
|
46
|
+
## 5. Interactions
|
|
47
|
+
|
|
48
|
+
Existing consumers retain the unchanged `files` and `loc` fields. New
|
|
49
|
+
consumers can inspect `scope`. The values are captured before any gate exit and
|
|
50
|
+
therefore accompany both passing and blocked decision records through the
|
|
51
|
+
existing verdict-finalization path.
|
|
52
|
+
|
|
53
|
+
## 6. External surfaces
|
|
54
|
+
|
|
55
|
+
Internal decision JSON gains one additive object. No runtime API, user-facing
|
|
56
|
+
message, configuration, credential, or operator action changes.
|
|
57
|
+
|
|
58
|
+
## 7. Multi-machine posture
|
|
59
|
+
|
|
60
|
+
Repository-replicated evidence. Decision records already ride the commit as
|
|
61
|
+
distinct files, so the new fields follow the same Git replication path and do
|
|
62
|
+
not introduce machine-local state or cross-machine authority.
|
|
63
|
+
|
|
64
|
+
## 8. Rollback cost
|
|
65
|
+
|
|
66
|
+
A direct revert removes the additive fields. Records already written with
|
|
67
|
+
`scope` remain readable by older consumers because they ignore unknown keys.
|
|
68
|
+
No migration or state repair is required.
|
|
69
|
+
|
|
70
|
+
## Conclusion
|
|
71
|
+
|
|
72
|
+
The change makes existing gate evidence interpretable without changing what
|
|
73
|
+
the gate decides.
|