peaks-loop 4.0.44 → 4.0.46
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/CHANGELOG.md +59 -0
- package/README-en.md +1 -1
- package/README.md +1 -1
- package/dist/cli/commands/code-runtime-commands.js +30 -19
- package/dist/cli/commands/codegraph-commands.d.ts +1 -0
- package/dist/cli/commands/codegraph-commands.js +49 -3
- package/dist/cli/commands/final-review-commands.js +3 -1
- package/dist/services/code/auto-compact-lifecycle.d.ts +39 -3
- package/dist/services/code/auto-compact-lifecycle.js +41 -6
- package/dist/services/code/auto-compact-orchestrator.js +20 -11
- package/dist/services/compact-statusline/compact-lifecycle-store.d.ts +11 -2
- package/dist/services/compact-statusline/compact-lifecycle-store.js +19 -1
- package/dist/services/compact-statusline/compact-statusline-service.d.ts +1 -1
- package/dist/services/compact-statusline/compact-statusline-service.js +22 -0
- package/dist/services/final-review/final-review-service.d.ts +224 -44
- package/dist/services/final-review/final-review-service.js +934 -97
- package/dist/services/final-review/index.d.ts +2 -1
- package/dist/services/final-review/index.js +2 -1
- package/dist/services/final-review/pre-post-diff.d.ts +137 -0
- package/dist/services/final-review/pre-post-diff.js +657 -0
- package/dist/services/skills/skill-statusline-renderer.js +30 -5
- package/dist/services/skills/statusline-palette.d.ts +6 -0
- package/dist/services/skills/statusline-palette.js +4 -1
- package/package.json +5 -5
- package/skills/peaks-code/SKILL.md +2 -2
- package/skills/peaks-final-review/SKILL.md +51 -18
- package/skills/peaks-final-review/references/4-dimensions.md +42 -5
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { prepareFinalReview, type PrepareFinalReviewOptions, type LlmRunner, IncompleteFinalReviewError, MAX_EVIDENCE_BYTES_PER_FILE, MAX_EVIDENCE_BYTES_TOTAL, } from './final-review-service.js';
|
|
1
|
+
export { prepareFinalReview, type PrepareFinalReviewOptions, type LlmRunner, IncompleteFinalReviewError, MAX_EVIDENCE_BYTES_PER_FILE, MAX_EVIDENCE_BYTES_TOTAL, assertFloorReservationAffordable, undeliverableDimensions, type UndeliverableDimensionEvidence, } from './final-review-service.js';
|
|
2
|
+
export { classifyPrePostDiffVerdict, type PrePostDiffConclusion, } from './pre-post-diff.js';
|
|
2
3
|
export type { DimensionKind, DimensionVerdict, EvidenceKind, DimensionConfidence, EvidenceItem, DimensionEvidence, FinalReviewOutput, } from './final-review-types.js';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { prepareFinalReview, IncompleteFinalReviewError, MAX_EVIDENCE_BYTES_PER_FILE, MAX_EVIDENCE_BYTES_TOTAL, } from './final-review-service.js';
|
|
1
|
+
export { prepareFinalReview, IncompleteFinalReviewError, MAX_EVIDENCE_BYTES_PER_FILE, MAX_EVIDENCE_BYTES_TOTAL, assertFloorReservationAffordable, undeliverableDimensions, } from './final-review-service.js';
|
|
2
|
+
export { classifyPrePostDiffVerdict, } from './pre-post-diff.js';
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pre-post-diff` producer — the missing evidence source for the
|
|
3
|
+
* `existing-functionality-intact` dimension of `peaks prepare-final-review`.
|
|
4
|
+
*
|
|
5
|
+
* THE GAP THIS CLOSES. The dimension's own contract
|
|
6
|
+
* (`skills/peaks-final-review/references/4-dimensions.md`) asks for "a pre/post
|
|
7
|
+
* baseline diff [showing] no unintended drift in the test surface, public API,
|
|
8
|
+
* or key behavior" — an `EvidenceItem` of kind `pre-post-diff`. Nothing in
|
|
9
|
+
* peaks-loop produced one: the sources mapped to that dimension were
|
|
10
|
+
* `rd/tech-doc.md` (design intent) and `prd/handoff.md` (approved scope), and
|
|
11
|
+
* the reviewer LLM itself reported the mismatch ("the only FOUND source is a
|
|
12
|
+
* design-intent document, not a regression assessment"). `allPass === true`
|
|
13
|
+
* was therefore unreachable by construction, on every workflow.
|
|
14
|
+
*
|
|
15
|
+
* WHAT IT DOES. Compares a base ref against the working tree with git (no new
|
|
16
|
+
* dependency; `git` is already the repo's baseline tool) and records two
|
|
17
|
+
* structural surfaces:
|
|
18
|
+
* 1. test surface — the test FILE lists, and `it(` / `test(` case counts,
|
|
19
|
+
* before/after;
|
|
20
|
+
* 2. public API surface — the `.ts` / `.tsx` SOURCE FILE lists, the top-level
|
|
21
|
+
* `export` statement count, and the ADDED/REMOVED export NAMES over the
|
|
22
|
+
* changed files.
|
|
23
|
+
*
|
|
24
|
+
* WHAT IT DELIBERATELY DOES NOT DO. It never invents a baseline. When no base
|
|
25
|
+
* ref resolves — or the project is not a git work tree at all, or the base
|
|
26
|
+
* resolves to HEAD itself so the compared range is empty — it returns
|
|
27
|
+
* `unavailable` with a reason and writes NO artifact, so the dimension has no
|
|
28
|
+
* `pre-post-diff` evidence and cannot be reported `pass` on the strength of a
|
|
29
|
+
* fabricated (or empty) diff.
|
|
30
|
+
*
|
|
31
|
+
* HONESTY BOUNDARY (also written into the artifact itself). Export detection is
|
|
32
|
+
* a line-anchored REGEX, not a type checker. It detects a structural loss — an
|
|
33
|
+
* export that was removed or renamed — and it CANNOT detect a signature change,
|
|
34
|
+
* a narrowed type, or a behaviour change inside a function body. It is a drift
|
|
35
|
+
* detector, not proof that the API is unchanged. File-level deletion IS visible,
|
|
36
|
+
* because it is read from the file lists rather than inferred from the counts.
|
|
37
|
+
*
|
|
38
|
+
* THE VERDICT COMES FIRST. The artifact opens with its `VERDICT:` line, above
|
|
39
|
+
* the metadata and the counts. The consumer may legitimately receive only the
|
|
40
|
+
* head of this file (it is an evidence source under a per-file byte cap), and
|
|
41
|
+
* with the conclusion at the end every such truncation dropped exactly the part
|
|
42
|
+
* the dimension has to judge — so a partially delivered artifact was
|
|
43
|
+
* indistinguishable from a clean comparison. Conclusion-first makes "the
|
|
44
|
+
* reviewer got the answer" a property of the bytes received.
|
|
45
|
+
*/
|
|
46
|
+
/** Path segments (under `.peaks/_runtime/<sessionId>/`) the artifact lands at. */
|
|
47
|
+
export declare const API_DIFF_ARTIFACT_SEGMENTS: readonly ["final-review", "api-diff.txt"];
|
|
48
|
+
/**
|
|
49
|
+
* The literal that opens the artifact's conclusion line.
|
|
50
|
+
*
|
|
51
|
+
* Exported because the consumer must be able to test for the CONCLUSION, not
|
|
52
|
+
* for a byte count (F-BLOCK-1BYTE): one byte of `api-diff.txt` satisfied
|
|
53
|
+
* "status: found" while conveying nothing, and the delivery gate it fed then let
|
|
54
|
+
* a `pass` stand on a comparison nobody saw. The producer writes the line this
|
|
55
|
+
* marker opens and `final-review-service.ts` requires it in the delivered
|
|
56
|
+
* bytes, so the two cannot drift apart into the same hole again.
|
|
57
|
+
*/
|
|
58
|
+
export declare const PRE_POST_DIFF_VERDICT_MARKER = "VERDICT: ";
|
|
59
|
+
/**
|
|
60
|
+
* The three conclusions the artifact may open with, exported as the same
|
|
61
|
+
* literals the writer interpolates below.
|
|
62
|
+
*
|
|
63
|
+
* They are constants because reading the conclusion is now part of the
|
|
64
|
+
* consumer's job (F2): the pre/post-diff source is the one source whose
|
|
65
|
+
* conclusion had a machine-readable form all along, and the envelope threw it
|
|
66
|
+
* away — a delivered `STRUCTURAL DRIFT DETECTED` produced `allPass: true` with
|
|
67
|
+
* an empty `needsAttention`. A consumer that must classify the conclusion may
|
|
68
|
+
* only do so against the producer's own literals, never against a re-typed
|
|
69
|
+
* copy of them.
|
|
70
|
+
*/
|
|
71
|
+
export declare const PRE_POST_DIFF_NO_DRIFT = "NO STRUCTURAL DRIFT";
|
|
72
|
+
export declare const PRE_POST_DIFF_ADDITIONS_ONLY = "ADDITIONS ONLY";
|
|
73
|
+
export declare const PRE_POST_DIFF_DRIFT_DETECTED = "STRUCTURAL DRIFT DETECTED";
|
|
74
|
+
/**
|
|
75
|
+
* What the artifact's conclusion LINE says, read from the bytes a consumer
|
|
76
|
+
* actually received.
|
|
77
|
+
*
|
|
78
|
+
* `indeterminate` is not "nothing to report": it is "the line is there (or is
|
|
79
|
+
* not) and this consumer cannot classify it", which for a drift DETECTOR is a
|
|
80
|
+
* fact a human has to see — see `enforceStructuralDriftAttention`.
|
|
81
|
+
*/
|
|
82
|
+
export type PrePostDiffConclusion = 'no-drift' | 'additions-only' | 'drift-detected' | 'indeterminate';
|
|
83
|
+
/**
|
|
84
|
+
* Classify the delivered conclusion. Pure and total: a caller passes the bytes
|
|
85
|
+
* it received (possibly a head slice) and gets back what the artifact says.
|
|
86
|
+
*
|
|
87
|
+
* Only the FIRST `VERDICT:` line is read. The artifact's header promises the
|
|
88
|
+
* verdict "is repeated nowhere" and that it is the file's conclusion, so a
|
|
89
|
+
* later line cannot be the answer, and reading further would let a document's
|
|
90
|
+
* prose masquerade as its conclusion.
|
|
91
|
+
*/
|
|
92
|
+
export declare function classifyPrePostDiffVerdict(content: string): PrePostDiffConclusion;
|
|
93
|
+
/** Test-file globs — the single definition both the file count and the case
|
|
94
|
+
* count use, so the two can never disagree about what a "test file" is. */
|
|
95
|
+
export declare const TEST_FILE_GLOBS: readonly ["*.test.ts", "*.test.tsx", "*.spec.ts", "*.spec.tsx"];
|
|
96
|
+
/** Source globs for the public-API surface. */
|
|
97
|
+
export declare const API_SOURCE_GLOBS: readonly ["*.ts", "*.tsx"];
|
|
98
|
+
export interface PrePostDiffComputed {
|
|
99
|
+
readonly status: 'computed';
|
|
100
|
+
readonly summary: string;
|
|
101
|
+
readonly relativePath: string;
|
|
102
|
+
readonly absolutePath: string;
|
|
103
|
+
readonly content: string;
|
|
104
|
+
}
|
|
105
|
+
export interface PrePostDiffUnavailable {
|
|
106
|
+
readonly status: 'unavailable';
|
|
107
|
+
/** Why no baseline exists, in the operator's terms. */
|
|
108
|
+
readonly reason: string;
|
|
109
|
+
/**
|
|
110
|
+
* `true` when the project root IS a git work tree — i.e. a baseline was
|
|
111
|
+
* expected to be computable and was not. That distinction shapes the REASON
|
|
112
|
+
* the operator is given (a tooling failure to fix, versus a project that has
|
|
113
|
+
* no baseline to offer), and the service refuses a `pass` on this dimension
|
|
114
|
+
* either way: "not a git repository" is the CAUSE of the missing evidence,
|
|
115
|
+
* never a licence to trust the claim the evidence was supposed to support.
|
|
116
|
+
*/
|
|
117
|
+
readonly inGitWorkTree: boolean;
|
|
118
|
+
}
|
|
119
|
+
export type PrePostDiffResult = PrePostDiffComputed | PrePostDiffUnavailable;
|
|
120
|
+
export interface ProducePrePostDiffOptions {
|
|
121
|
+
readonly projectRoot: string;
|
|
122
|
+
readonly sessionId: string;
|
|
123
|
+
/** Explicit base ref. Unset ⇒ merge-base with the upstream default branch. */
|
|
124
|
+
readonly baseRef?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The exported NAMES bound by one source line. Approximate by design: the
|
|
128
|
+
* column-0 anchor is what keeps it to top-level declarations, and
|
|
129
|
+
* `export { a as b }` binds `b` (the name importers get).
|
|
130
|
+
*/
|
|
131
|
+
export declare function extractExportedNames(line: string): readonly string[];
|
|
132
|
+
/**
|
|
133
|
+
* Produce the diff, or say why it could not be produced. Total: it never
|
|
134
|
+
* throws, because a final review must not die on a missing git binary — it
|
|
135
|
+
* must report a dimension it could not assess.
|
|
136
|
+
*/
|
|
137
|
+
export declare function producePrePostDiff(opts: ProducePrePostDiffOptions): PrePostDiffResult;
|