@iamu-dev/iamu 0.6.0-beta.0 → 0.8.0-beta.0
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/bin.js +5357 -1675
- package/dist/commands/browse.d.ts +18 -0
- package/dist/commands/design-draft.d.ts +11 -0
- package/dist/commands/design-output.d.ts +8 -0
- package/dist/commands/doctor-design.d.ts +9 -0
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/finding-stability.d.ts +71 -0
- package/dist/commands/fix-brief.d.ts +6 -2
- package/dist/commands/live-run-client.d.ts +1 -0
- package/dist/commands/report-data.d.ts +2 -1
- package/dist/commands/set-entity.d.ts +7 -0
- package/dist/commands/timings.d.ts +19 -0
- package/dist/commands/triage.d.ts +6 -0
- package/dist/index.js +5322 -1665
- package/dist/templates/prompts/advise.md +1 -0
- package/dist/templates/prompts/complete.md +1 -1
- package/dist/templates/prompts/design-review.md +9 -0
- package/dist/templates/prompts/designer.md +2 -0
- package/dist/templates/prompts/walk.md +1 -0
- package/dist/templates/skills/iamu-design.md +36 -7
- package/dist/templates/skills/iamu-findings.md +24 -27
- package/dist/templates/skills/iamu-run.md +58 -56
- package/dist/templates/skills/iamu-setup.md +6 -5
- package/dist/ui/report-view.d.ts +5 -0
- package/package.json +4 -4
|
@@ -22,6 +22,8 @@ export interface BrowseOptions {
|
|
|
22
22
|
json?: boolean;
|
|
23
23
|
/** Annotate snapshot with 1-based index numbers [#N] for click-index / fill-index */
|
|
24
24
|
indexed?: boolean;
|
|
25
|
+
/** `clear-storage`: the origin to clear (default: the run's target URL). */
|
|
26
|
+
origin?: string;
|
|
25
27
|
}
|
|
26
28
|
interface BrowseState {
|
|
27
29
|
port: number;
|
|
@@ -176,6 +178,22 @@ export declare function detectAntiBotChallenge(page: Page, allowEvaluate?: boole
|
|
|
176
178
|
export declare function withPage(opts: BrowseOptions, driver: BrowserDriver, fn: (page: Page) => Promise<void>,
|
|
177
179
|
/** What the action looks for, named for the error message. */
|
|
178
180
|
target?: string): Promise<PageResult | null>;
|
|
181
|
+
/** What {@link clearOriginStorage} removed. */
|
|
182
|
+
export interface ClearedStorage {
|
|
183
|
+
origin: string;
|
|
184
|
+
local_storage_keys: string[];
|
|
185
|
+
cookies: string[];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Leave the page for `about:blank` (so the app cannot write its state
|
|
189
|
+
* back on unload), then clear cookies, localStorage, IndexedDB and
|
|
190
|
+
* caches for `origin`. Returns what was there, or an error message.
|
|
191
|
+
*/
|
|
192
|
+
export declare function clearOriginStorage(origin: string, driver?: BrowserDriver,
|
|
193
|
+
/** Page to open after clearing (the run's start URL); else about:blank. */
|
|
194
|
+
returnTo?: string): Promise<ClearedStorage | {
|
|
195
|
+
error: string;
|
|
196
|
+
}>;
|
|
179
197
|
/**
|
|
180
198
|
* `iamu browse <command> [args…]` — dispatch one browse subcommand.
|
|
181
199
|
* Failures print to stderr and set exit code 1.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DesignOptions } from "./design-output.js";
|
|
2
|
+
/**
|
|
3
|
+
* Print a design doc draft in iamu's layout, filled in from the code;
|
|
4
|
+
* with --out also write it there; with --decline record that the offer
|
|
5
|
+
* was declined instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare function designTemplate(opts: DesignOptions): Promise<void>;
|
|
8
|
+
/** Check a draft: errors and warnings, writing nothing. */
|
|
9
|
+
export declare function designDraftCheck(opts: DesignOptions): Promise<void>;
|
|
10
|
+
/** Write a draft as the project's design doc and record it. */
|
|
11
|
+
export declare function designAdopt(opts: DesignOptions): Promise<void>;
|
|
@@ -23,6 +23,14 @@ export interface DesignOptions {
|
|
|
23
23
|
* the designer's earlier notes, so it cannot just confirm them.
|
|
24
24
|
*/
|
|
25
25
|
blind?: boolean;
|
|
26
|
+
/** template, draft-check, adopt: the app the doc is for. */
|
|
27
|
+
dir?: string;
|
|
28
|
+
/** template: also write the draft to this file. */
|
|
29
|
+
out?: string;
|
|
30
|
+
/** template: record that the offer was declined. */
|
|
31
|
+
decline?: boolean;
|
|
32
|
+
/** adopt: where the doc goes (default: <dir>/DESIGN.md). */
|
|
33
|
+
to?: string;
|
|
26
34
|
}
|
|
27
35
|
/** JSON with --json, else the human output. */
|
|
28
36
|
export declare const out: (opts: DesignOptions, value: unknown, human: () => void) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DoctorCheck } from "./doctor.js";
|
|
2
|
+
/**
|
|
3
|
+
* The design docs the project recorded: files that are gone, references
|
|
4
|
+
* inside them to paths, components and tokens that no longer exist, an
|
|
5
|
+
* unmigrated legacy doc, stale proposals and an outdated agent block.
|
|
6
|
+
* No recorded docs is not a fault: the designer then reviews by general
|
|
7
|
+
* craft, so it is reported as ok with a hint.
|
|
8
|
+
*/
|
|
9
|
+
export declare function checkDesignDocs(projectRoot: string): Promise<DoctorCheck[]>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spike (fast-critic-loop D6): how stable each finding has been across
|
|
3
|
+
* its scenario's runs, computed on read from local run history. No new
|
|
4
|
+
* stored field; the harden phase moves this into the match stage.
|
|
5
|
+
*
|
|
6
|
+
* A data point per non-blocked completed run of the scenario, oldest
|
|
7
|
+
* first, from the finding's first observation on:
|
|
8
|
+
* - `1` the run recorded it: a finding file of that run carries its
|
|
9
|
+
* `canonical_id`, or the run's verification says it persists;
|
|
10
|
+
* - `0` the run re-checked it and saw it working: `verification.resolved`
|
|
11
|
+
* or the matcher's `rechecked_fixed` (step-backed, not absence);
|
|
12
|
+
* - no point at all when the run said nothing about it (`not_observed`,
|
|
13
|
+
* `uncertain`, or it was not part of the comparison). A walk that took
|
|
14
|
+
* another path is not evidence of a flicker, the same rule as
|
|
15
|
+
* `fix-state.ts` ("never from absence").
|
|
16
|
+
*
|
|
17
|
+
* `unstable` when the points since the last fix (a finding with that
|
|
18
|
+
* canonical id triaged `addressed`/`fixed`) change value two or more
|
|
19
|
+
* times; `first_seen` when it was observed once; otherwise `stable`.
|
|
20
|
+
*/
|
|
21
|
+
import { type RunEvidence } from "@iamu-dev/local-store";
|
|
22
|
+
/** How far a builder can trust a finding to be real and lasting. */
|
|
23
|
+
export type FindingStability = "stable" | "unstable" | "first_seen";
|
|
24
|
+
/** One run's word on a finding: observed (1) or re-checked fixed (0). */
|
|
25
|
+
export interface StabilityPoint {
|
|
26
|
+
observed: boolean;
|
|
27
|
+
/** Run start, epoch ms; null when unknown. */
|
|
28
|
+
at: number | null;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The D6 rule on one finding's chronological points.
|
|
32
|
+
*
|
|
33
|
+
* @param points - Oldest first; runs with no word on the finding left out.
|
|
34
|
+
* @param fixedAt - Epoch ms of the latest recorded fix, or null.
|
|
35
|
+
* @returns `first_seen`, `unstable` or `stable`.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* stabilityOf([{ observed: true, at: 1 }, { observed: false, at: 2 }, { observed: true, at: 3 }], null);
|
|
40
|
+
* // "unstable"
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function stabilityOf(points: readonly StabilityPoint[], fixedAt: number | null): FindingStability;
|
|
44
|
+
interface HistoryFinding {
|
|
45
|
+
run?: string;
|
|
46
|
+
scenario?: string;
|
|
47
|
+
canonical_id?: string;
|
|
48
|
+
triage_status?: string;
|
|
49
|
+
updated_at?: string;
|
|
50
|
+
created_at?: string;
|
|
51
|
+
source?: string;
|
|
52
|
+
lens?: string;
|
|
53
|
+
}
|
|
54
|
+
/** What the stability read needs from disk; load once per report. */
|
|
55
|
+
export interface StabilityHistory {
|
|
56
|
+
runs: RunEvidence[];
|
|
57
|
+
findings: HistoryFinding[];
|
|
58
|
+
}
|
|
59
|
+
/** Read the run evidence and finding files once. Never throws. */
|
|
60
|
+
export declare function loadStabilityHistory(projectRoot: string): Promise<StabilityHistory>;
|
|
61
|
+
/**
|
|
62
|
+
* Stability of every canonical finding of `scenario`, as of `runId`
|
|
63
|
+
* (later runs are not its past).
|
|
64
|
+
*
|
|
65
|
+
* @param history - From {@link loadStabilityHistory}.
|
|
66
|
+
* @param scenario - Scenario slug.
|
|
67
|
+
* @param runId - The run being reported; runs after it are ignored.
|
|
68
|
+
* @returns canonical id → stability.
|
|
69
|
+
*/
|
|
70
|
+
export declare function scenarioStability(history: StabilityHistory, scenario: string, runId: string): Map<string, FindingStability>;
|
|
71
|
+
export {};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { type DesignerFixBrief, type FixBrief } from "@iamu-dev/local-store";
|
|
2
|
-
export declare function fixBrief(ref: string, opts: {
|
|
2
|
+
export declare function fixBrief(ref: string | undefined, opts: {
|
|
3
|
+
wave?: boolean;
|
|
3
4
|
json?: boolean;
|
|
4
5
|
}): Promise<void>;
|
|
5
6
|
/**
|
|
6
7
|
* A loop step as a person reads it: each backticked field name becomes
|
|
7
8
|
* the section above that holds it, or its value.
|
|
8
9
|
*/
|
|
9
|
-
export declare function readable(step: string, b: Pick<FixBrief | DesignerFixBrief, "
|
|
10
|
+
export declare function readable(step: string, b: Pick<FixBrief | DesignerFixBrief, "closing_check"> & {
|
|
11
|
+
rerun?: string | string[];
|
|
12
|
+
scenarios_to_rerun?: string[];
|
|
13
|
+
}): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CanonicalWalkthrough } from "@iamu-dev/protocol";
|
|
2
2
|
import { type OverviewView, type RunView, type VerdictLabel } from "../ui/report-view.js";
|
|
3
|
+
import { type StabilityHistory } from "./finding-stability.js";
|
|
3
4
|
export interface CompletedRun {
|
|
4
5
|
runId: string;
|
|
5
6
|
manifest: Record<string, unknown>;
|
|
@@ -12,5 +13,5 @@ export declare function readCompletedRuns(projectRoot: string, runIds: string[],
|
|
|
12
13
|
export declare function verdictLabel(c: CanonicalWalkthrough | null): VerdictLabel;
|
|
13
14
|
/** "/request · step 8" from a page URL and a step id. */
|
|
14
15
|
export declare function whereOf(pageUrl: unknown, stepId: unknown): string | null;
|
|
15
|
-
export declare function buildRunView(projectRoot: string, run: CompletedRun): Promise<RunView>;
|
|
16
|
+
export declare function buildRunView(projectRoot: string, run: CompletedRun, history?: StabilityHistory): Promise<RunView>;
|
|
16
17
|
export declare function buildOverview(projectRoot: string, runs: CompletedRun[]): Promise<OverviewView>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ContextFrontmatter } from "@iamu-dev/protocol";
|
|
1
2
|
/**
|
|
2
3
|
* Options for `iamu set`. Every field is staging: where a walk starts,
|
|
3
4
|
* what the world holds, which account a persona uses, which routes an
|
|
@@ -52,6 +53,12 @@ export interface SetEntityOptions {
|
|
|
52
53
|
description?: string | false;
|
|
53
54
|
/** Project name (context). */
|
|
54
55
|
name?: string | false;
|
|
56
|
+
/** Governing documents/standards (context patch). */
|
|
57
|
+
governedBy?: ContextFrontmatter["governed_by"] | false;
|
|
58
|
+
/** Domain actors (context patch). */
|
|
59
|
+
actors?: ContextFrontmatter["actors"] | false;
|
|
60
|
+
/** Domain glossary (context patch). */
|
|
61
|
+
glossary?: ContextFrontmatter["glossary"] | false;
|
|
55
62
|
/** Markdown body narrative (testability, context). */
|
|
56
63
|
body?: string;
|
|
57
64
|
/** JSON patch file (or - for stdin) containing staging fields. */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** A bracket around a pipeline stage: `start` when a command begins, `end` when it has written its output. */
|
|
2
|
+
export type TimingEvent = "start" | "end";
|
|
3
|
+
/**
|
|
4
|
+
* Spike (fast-critic-loop D0): append one rough timing line to
|
|
5
|
+
* `<runDir>/timings.jsonl`. Never creates the run directory and never
|
|
6
|
+
* throws — a timing that cannot be written is simply lost, so a command
|
|
7
|
+
* never fails because of it. No lock: concurrent appends of one short
|
|
8
|
+
* line are fine for a rough read.
|
|
9
|
+
*
|
|
10
|
+
* @param runDirPath - Absolute path of the run directory (`iamu/.runs/<id>`).
|
|
11
|
+
* @param stage - The command name, e.g. `match-record`.
|
|
12
|
+
* @param event - `start` or `end`.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* await logTiming(runDirPath, "match", "end");
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function logTiming(runDirPath: string | null | undefined, stage: string, event: TimingEvent): Promise<void>;
|
|
@@ -10,6 +10,12 @@ export interface TriageOptions {
|
|
|
10
10
|
scope?: string;
|
|
11
11
|
/** `false` (`--no-guidance`): dismiss without writing a guidance rule. */
|
|
12
12
|
guidance?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Project-wide sweep ("we never want X"): dismiss all matching open
|
|
15
|
+
* persona and designer findings across the project and record a
|
|
16
|
+
* project-wide guidance rule.
|
|
17
|
+
*/
|
|
18
|
+
sweep?: boolean | string;
|
|
13
19
|
json?: boolean;
|
|
14
20
|
}
|
|
15
21
|
/**
|