@ai-sdlc/orchestrator 0.6.0 → 0.10.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/__test-helpers/git-env.d.ts +40 -0
- package/dist/__test-helpers/git-env.js +73 -0
- package/dist/admission-composite.d.ts +89 -0
- package/dist/admission-composite.js +241 -0
- package/dist/admission-enrichment.d.ts +142 -0
- package/dist/admission-enrichment.js +341 -0
- package/dist/admission-hc.d.ts +81 -0
- package/dist/admission-hc.js +94 -0
- package/dist/admission-score.d.ts +109 -5
- package/dist/admission-score.js +90 -11
- package/dist/analysis/analyzer.js +3 -2
- package/dist/analysis/convention-detector.d.ts +85 -2
- package/dist/analysis/convention-detector.js +375 -70
- package/dist/analysis/diff-analyzer.d.ts +33 -0
- package/dist/analysis/diff-analyzer.js +122 -0
- package/dist/analysis/hotspot-analyzer.js +3 -1
- package/dist/analysis/index.d.ts +2 -1
- package/dist/analysis/index.js +2 -1
- package/dist/artifacts/index.d.ts +65 -0
- package/dist/artifacts/index.js +142 -0
- package/dist/backlog-adapter.d.ts +121 -0
- package/dist/backlog-adapter.js +438 -0
- package/dist/calibration.d.ts +43 -0
- package/dist/calibration.js +76 -0
- package/dist/cli/commands/agents.d.ts +24 -0
- package/dist/cli/commands/agents.js +66 -1
- package/dist/cli/commands/git-remote.d.ts +74 -0
- package/dist/cli/commands/git-remote.js +170 -0
- package/dist/cli/commands/health.d.ts +4 -0
- package/dist/cli/commands/health.js +13 -1
- package/dist/cli/commands/init-features.d.ts +208 -0
- package/dist/cli/commands/init-features.js +473 -0
- package/dist/cli/commands/init-templates.d.ts +104 -0
- package/dist/cli/commands/init-templates.js +399 -0
- package/dist/cli/commands/init.d.ts +48 -0
- package/dist/cli/commands/init.js +322 -23
- package/dist/cli/commands/mcp-setup.d.ts +31 -0
- package/dist/cli/commands/mcp-setup.js +78 -8
- package/dist/cli/formatters/table.js +15 -2
- package/dist/cli/index.d.ts +14 -1
- package/dist/cli/index.js +81 -20
- package/dist/cli/versions.d.ts +57 -0
- package/dist/cli/versions.js +128 -0
- package/dist/code-area-classifier.d.ts +21 -0
- package/dist/code-area-classifier.js +48 -0
- package/dist/config.d.ts +33 -1
- package/dist/config.js +78 -8
- package/dist/database/adapters/external.d.ts +24 -0
- package/dist/database/adapters/external.js +80 -0
- package/dist/database/adapters/neon.d.ts +41 -0
- package/dist/database/adapters/neon.js +98 -0
- package/dist/database/adapters/pg-snapshot-restore.d.ts +28 -0
- package/dist/database/adapters/pg-snapshot-restore.js +68 -0
- package/dist/database/adapters/sqlite-copy.d.ts +32 -0
- package/dist/database/adapters/sqlite-copy.js +145 -0
- package/dist/database/connection-injection.d.ts +35 -0
- package/dist/database/connection-injection.js +93 -0
- package/dist/database/index.d.ts +12 -0
- package/dist/database/index.js +23 -0
- package/dist/database/registry.d.ts +13 -0
- package/dist/database/registry.js +27 -0
- package/dist/database/topology.d.ts +52 -0
- package/dist/database/topology.js +44 -0
- package/dist/database/types.d.ts +89 -0
- package/dist/database/types.js +26 -0
- package/dist/design-authority.d.ts +53 -0
- package/dist/design-authority.js +84 -0
- package/dist/design-lookahead.d.ts +64 -0
- package/dist/design-lookahead.js +86 -0
- package/dist/design-quality-trend.d.ts +87 -0
- package/dist/design-quality-trend.js +190 -0
- package/dist/design-system-context.d.ts +46 -0
- package/dist/design-system-context.js +80 -0
- package/dist/design-system-correction-loop.d.ts +64 -0
- package/dist/design-system-correction-loop.js +128 -0
- package/dist/design-system-metrics.d.ts +61 -0
- package/dist/design-system-metrics.js +104 -0
- package/dist/design-system-stewardship.d.ts +22 -0
- package/dist/design-system-stewardship.js +85 -0
- package/dist/design-system-validation.d.ts +37 -0
- package/dist/design-system-validation.js +88 -0
- package/dist/dispatch/index.d.ts +4 -0
- package/dist/dispatch/index.js +4 -0
- package/dist/dispatch/merge-gate.d.ts +46 -0
- package/dist/dispatch/merge-gate.js +90 -0
- package/dist/dispatch/requeue.d.ts +57 -0
- package/dist/dispatch/requeue.js +131 -0
- package/dist/dispatch/worker-pool.d.ts +62 -0
- package/dist/dispatch/worker-pool.js +60 -0
- package/dist/execute.d.ts +40 -0
- package/dist/execute.js +188 -15
- package/dist/fix-ci.js +8 -1
- package/dist/fix-review.js +8 -1
- package/dist/harness/adapters/claude-code.d.ts +29 -0
- package/dist/harness/adapters/claude-code.js +191 -0
- package/dist/harness/adapters/codex.d.ts +25 -0
- package/dist/harness/adapters/codex.js +61 -0
- package/dist/harness/independence.d.ts +51 -0
- package/dist/harness/independence.js +67 -0
- package/dist/harness/index.d.ts +14 -0
- package/dist/harness/index.js +20 -0
- package/dist/harness/registry.d.ts +17 -0
- package/dist/harness/registry.js +31 -0
- package/dist/harness/types.d.ts +123 -0
- package/dist/harness/types.js +8 -0
- package/dist/harness/version-probe.d.ts +14 -0
- package/dist/harness/version-probe.js +123 -0
- package/dist/index.d.ts +30 -4
- package/dist/index.js +35 -2
- package/dist/models/classifier.d.ts +78 -0
- package/dist/models/classifier.js +277 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/dist/models/registry.d.ts +97 -0
- package/dist/models/registry.js +173 -0
- package/dist/pillar-breakdown.d.ts +85 -0
- package/dist/pillar-breakdown.js +162 -0
- package/dist/priority.d.ts +5 -0
- package/dist/priority.js +18 -5
- package/dist/review-meta.d.ts +65 -0
- package/dist/review-meta.js +149 -0
- package/dist/review.d.ts +4 -0
- package/dist/review.js +12 -2
- package/dist/runners/claude-code-sdk.d.ts +31 -0
- package/dist/runners/claude-code-sdk.js +238 -0
- package/dist/runners/claude-code.d.ts +3 -0
- package/dist/runners/claude-code.js +30 -66
- package/dist/runners/codex.js +4 -1
- package/dist/runners/copilot.js +4 -1
- package/dist/runners/cursor.js +4 -1
- package/dist/runners/git-utils.d.ts +81 -0
- package/dist/runners/git-utils.js +201 -0
- package/dist/runners/index.d.ts +3 -0
- package/dist/runners/index.js +3 -0
- package/dist/runners/review-agent.d.ts +20 -0
- package/dist/runners/review-agent.js +171 -41
- package/dist/runners/runner-registry.js +10 -0
- package/dist/runners/sdk-review-runner.d.ts +65 -0
- package/dist/runners/sdk-review-runner.js +185 -0
- package/dist/runners/security-triage.d.ts +20 -4
- package/dist/runners/security-triage.js +39 -15
- package/dist/runners/types.d.ts +6 -0
- package/dist/runtime/attestations.d.ts +766 -0
- package/dist/runtime/attestations.js +1195 -0
- package/dist/runtime/git-env.d.ts +53 -0
- package/dist/runtime/git-env.js +60 -0
- package/dist/runtime/index.d.ts +7 -0
- package/dist/runtime/index.js +7 -0
- package/dist/runtime/parallelism-flag.d.ts +28 -0
- package/dist/runtime/parallelism-flag.js +39 -0
- package/dist/runtime/port-allocator.d.ts +32 -0
- package/dist/runtime/port-allocator.js +96 -0
- package/dist/runtime/worktree-pool.d.ts +86 -0
- package/dist/runtime/worktree-pool.js +204 -0
- package/dist/runtime/worktree.d.ts +25 -0
- package/dist/runtime/worktree.js +111 -0
- package/dist/sa-scoring/auto-calibrate.d.ts +69 -0
- package/dist/sa-scoring/auto-calibrate.js +107 -0
- package/dist/sa-scoring/c1-sa2-computable.d.ts +42 -0
- package/dist/sa-scoring/c1-sa2-computable.js +59 -0
- package/dist/sa-scoring/composite.d.ts +107 -0
- package/dist/sa-scoring/composite.js +139 -0
- package/dist/sa-scoring/depparse-client.d.ts +79 -0
- package/dist/sa-scoring/depparse-client.js +187 -0
- package/dist/sa-scoring/did-compiler.d.ts +122 -0
- package/dist/sa-scoring/did-compiler.js +286 -0
- package/dist/sa-scoring/drift-monitor.d.ts +84 -0
- package/dist/sa-scoring/drift-monitor.js +186 -0
- package/dist/sa-scoring/exemplar-bank.d.ts +78 -0
- package/dist/sa-scoring/exemplar-bank.js +154 -0
- package/dist/sa-scoring/feedback-store.d.ts +100 -0
- package/dist/sa-scoring/feedback-store.js +156 -0
- package/dist/sa-scoring/index.d.ts +71 -0
- package/dist/sa-scoring/index.js +158 -0
- package/dist/sa-scoring/layer1-deterministic.d.ts +115 -0
- package/dist/sa-scoring/layer1-deterministic.js +298 -0
- package/dist/sa-scoring/layer2-structural.d.ts +71 -0
- package/dist/sa-scoring/layer2-structural.js +151 -0
- package/dist/sa-scoring/layer3-llm.d.ts +86 -0
- package/dist/sa-scoring/layer3-llm.js +282 -0
- package/dist/sa-scoring/rescore-orchestrator.d.ts +52 -0
- package/dist/sa-scoring/rescore-orchestrator.js +47 -0
- package/dist/scheduling/burn-down.d.ts +27 -0
- package/dist/scheduling/burn-down.js +43 -0
- package/dist/scheduling/calibration.d.ts +42 -0
- package/dist/scheduling/calibration.js +150 -0
- package/dist/scheduling/index.d.ts +8 -0
- package/dist/scheduling/index.js +8 -0
- package/dist/scheduling/ledger.d.ts +59 -0
- package/dist/scheduling/ledger.js +216 -0
- package/dist/scheduling/off-peak.d.ts +27 -0
- package/dist/scheduling/off-peak.js +112 -0
- package/dist/scheduling/schedule-decision.d.ts +39 -0
- package/dist/scheduling/schedule-decision.js +89 -0
- package/dist/scheduling/tier-analysis.d.ts +47 -0
- package/dist/scheduling/tier-analysis.js +81 -0
- package/dist/scheduling/types.d.ts +140 -0
- package/dist/scheduling/types.js +11 -0
- package/dist/shared.d.ts +13 -0
- package/dist/shared.js +32 -0
- package/dist/state/schema.d.ts +5 -1
- package/dist/state/schema.js +223 -1
- package/dist/state/store.d.ts +55 -1
- package/dist/state/store.js +342 -7
- package/dist/state/types.d.ts +139 -0
- package/dist/types.d.ts +1 -1
- package/dist/validate-agent-output.js +4 -1
- package/dist/watch.js +6 -0
- package/package.json +3 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model alias registry per RFC-0010 §11. Maps short aliases (haiku, sonnet, opus, opus[1m])
|
|
3
|
+
* to physical model IDs and tracks deprecation lifecycle (deprecatedAt / removedAt /
|
|
4
|
+
* replacementAlias). Resolution is performed once at pipeline-load and pinned per run
|
|
5
|
+
* (RFC §11.1) so model swaps cannot occur underneath an in-flight pipeline.
|
|
6
|
+
*/
|
|
7
|
+
export interface ModelEntry {
|
|
8
|
+
/** Short alias used in pipeline YAML (e.g., 'haiku'). */
|
|
9
|
+
alias: string;
|
|
10
|
+
/** Physical model ID dispatched to the harness (e.g., 'claude-haiku-4-5-20251001'). */
|
|
11
|
+
modelId: string;
|
|
12
|
+
/** ISO 8601 date when the vendor announced deprecation; null if active. */
|
|
13
|
+
deprecatedAt: string | null;
|
|
14
|
+
/** ISO 8601 date when the vendor will (or did) remove the model; null if not scheduled. */
|
|
15
|
+
removedAt: string | null;
|
|
16
|
+
/** Alias to migrate to when this entry is deprecated; required when deprecatedAt is set. */
|
|
17
|
+
replacementAlias: string | null;
|
|
18
|
+
/** Documentation hint, surfaced by cli-model-bump. */
|
|
19
|
+
use?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ResolutionContext {
|
|
22
|
+
/** Source of `now` for deprecation comparisons; defaults to system clock. */
|
|
23
|
+
now?: () => Date;
|
|
24
|
+
}
|
|
25
|
+
export type ResolutionEvent = {
|
|
26
|
+
type: 'ok';
|
|
27
|
+
alias: string;
|
|
28
|
+
modelId: string;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'ModelDeprecated';
|
|
31
|
+
alias: string;
|
|
32
|
+
modelId: string;
|
|
33
|
+
removedAt: string | null;
|
|
34
|
+
replacementAlias: string | null;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'ModelDeprecationGracePeriod';
|
|
37
|
+
alias: string;
|
|
38
|
+
removedAt: string;
|
|
39
|
+
};
|
|
40
|
+
export interface ResolutionResult {
|
|
41
|
+
modelId: string;
|
|
42
|
+
events: ResolutionEvent[];
|
|
43
|
+
}
|
|
44
|
+
export declare class ModelRemovedError extends Error {
|
|
45
|
+
readonly alias: string;
|
|
46
|
+
readonly modelId: string;
|
|
47
|
+
readonly removedAt: string;
|
|
48
|
+
constructor(alias: string, modelId: string, removedAt: string);
|
|
49
|
+
}
|
|
50
|
+
export declare class UnknownAliasError extends Error {
|
|
51
|
+
readonly alias: string;
|
|
52
|
+
constructor(alias: string);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default registry shipped with the orchestrator. Maintainers update deprecatedAt /
|
|
56
|
+
* removedAt / replacementAlias from public vendor announcements (see operator-runbook).
|
|
57
|
+
*/
|
|
58
|
+
export declare const DEFAULT_REGISTRY: readonly ModelEntry[];
|
|
59
|
+
export declare class ModelRegistry {
|
|
60
|
+
private readonly entries;
|
|
61
|
+
constructor(entries?: readonly ModelEntry[]);
|
|
62
|
+
list(): ModelEntry[];
|
|
63
|
+
get(alias: string): ModelEntry | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Resolve an alias to a physical model ID at pipeline-load. Throws ModelRemovedError
|
|
66
|
+
* if the model has been removed; emits ModelDeprecated event otherwise (informational).
|
|
67
|
+
* Within `GRACE_PERIOD_DAYS` of the removal date, additionally emits
|
|
68
|
+
* ModelDeprecationGracePeriod for escalated operator notification.
|
|
69
|
+
*/
|
|
70
|
+
resolve(alias: string, ctx?: ResolutionContext): ResolutionResult;
|
|
71
|
+
/**
|
|
72
|
+
* Bulk-resolve a set of stage aliases. Emits one ResolutionResult per (stage, alias).
|
|
73
|
+
* Used at pipeline-load to pin model resolution for the whole pipeline run.
|
|
74
|
+
*/
|
|
75
|
+
resolveAll(stageAliases: ReadonlyArray<{
|
|
76
|
+
stage: string;
|
|
77
|
+
alias: string;
|
|
78
|
+
}>, ctx?: ResolutionContext): Map<string, ResolutionResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Operator-facing dry-run helper: for each currently deprecated alias, report what
|
|
81
|
+
* would happen if a pipeline started today. Used by cli-model-bump --dry-run.
|
|
82
|
+
*/
|
|
83
|
+
bumpPlan(stageAliases: ReadonlyArray<{
|
|
84
|
+
stage: string;
|
|
85
|
+
alias: string;
|
|
86
|
+
}>, ctx?: ResolutionContext): Array<{
|
|
87
|
+
stage: string;
|
|
88
|
+
alias: string;
|
|
89
|
+
currentModelId: string;
|
|
90
|
+
deprecatedAt: string | null;
|
|
91
|
+
removedAt: string | null;
|
|
92
|
+
replacementAlias: string | null;
|
|
93
|
+
replacementModelId: string | null;
|
|
94
|
+
inGracePeriod: boolean;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model alias registry per RFC-0010 §11. Maps short aliases (haiku, sonnet, opus, opus[1m])
|
|
3
|
+
* to physical model IDs and tracks deprecation lifecycle (deprecatedAt / removedAt /
|
|
4
|
+
* replacementAlias). Resolution is performed once at pipeline-load and pinned per run
|
|
5
|
+
* (RFC §11.1) so model swaps cannot occur underneath an in-flight pipeline.
|
|
6
|
+
*/
|
|
7
|
+
export class ModelRemovedError extends Error {
|
|
8
|
+
alias;
|
|
9
|
+
modelId;
|
|
10
|
+
removedAt;
|
|
11
|
+
constructor(alias, modelId, removedAt) {
|
|
12
|
+
super(`Model alias '${alias}' resolves to '${modelId}', which was removed at ${removedAt}`);
|
|
13
|
+
this.alias = alias;
|
|
14
|
+
this.modelId = modelId;
|
|
15
|
+
this.removedAt = removedAt;
|
|
16
|
+
this.name = 'ModelRemovedError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class UnknownAliasError extends Error {
|
|
20
|
+
alias;
|
|
21
|
+
constructor(alias) {
|
|
22
|
+
super(`Unknown model alias: ${alias}`);
|
|
23
|
+
this.alias = alias;
|
|
24
|
+
this.name = 'UnknownAliasError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const GRACE_PERIOD_DAYS = 30;
|
|
28
|
+
/**
|
|
29
|
+
* Default registry shipped with the orchestrator. Maintainers update deprecatedAt /
|
|
30
|
+
* removedAt / replacementAlias from public vendor announcements (see operator-runbook).
|
|
31
|
+
*/
|
|
32
|
+
export const DEFAULT_REGISTRY = [
|
|
33
|
+
{
|
|
34
|
+
alias: 'haiku',
|
|
35
|
+
modelId: 'claude-haiku-4-5-20251001',
|
|
36
|
+
deprecatedAt: null,
|
|
37
|
+
removedAt: null,
|
|
38
|
+
replacementAlias: null,
|
|
39
|
+
use: 'Classification, routing, formatting, structured-output extraction',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
alias: 'sonnet',
|
|
43
|
+
modelId: 'claude-sonnet-4-6',
|
|
44
|
+
deprecatedAt: null,
|
|
45
|
+
removedAt: null,
|
|
46
|
+
replacementAlias: null,
|
|
47
|
+
use: 'Code review, refactoring, validation, default for everything else',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
alias: 'opus',
|
|
51
|
+
modelId: 'claude-opus-4-7',
|
|
52
|
+
deprecatedAt: null,
|
|
53
|
+
removedAt: null,
|
|
54
|
+
replacementAlias: null,
|
|
55
|
+
use: 'Complex implementation, multi-file refactors, design work',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
alias: 'opus[1m]',
|
|
59
|
+
modelId: 'claude-opus-4-7[1m]',
|
|
60
|
+
deprecatedAt: null,
|
|
61
|
+
removedAt: null,
|
|
62
|
+
replacementAlias: null,
|
|
63
|
+
use: 'Implementation against a large codebase context (>200K tokens)',
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
export class ModelRegistry {
|
|
67
|
+
entries;
|
|
68
|
+
constructor(entries = DEFAULT_REGISTRY) {
|
|
69
|
+
this.entries = new Map(entries.map((e) => [e.alias, { ...e }]));
|
|
70
|
+
}
|
|
71
|
+
list() {
|
|
72
|
+
return Array.from(this.entries.values()).map((e) => ({ ...e }));
|
|
73
|
+
}
|
|
74
|
+
get(alias) {
|
|
75
|
+
const e = this.entries.get(alias);
|
|
76
|
+
return e ? { ...e } : undefined;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Resolve an alias to a physical model ID at pipeline-load. Throws ModelRemovedError
|
|
80
|
+
* if the model has been removed; emits ModelDeprecated event otherwise (informational).
|
|
81
|
+
* Within `GRACE_PERIOD_DAYS` of the removal date, additionally emits
|
|
82
|
+
* ModelDeprecationGracePeriod for escalated operator notification.
|
|
83
|
+
*/
|
|
84
|
+
resolve(alias, ctx = {}) {
|
|
85
|
+
const entry = this.entries.get(alias);
|
|
86
|
+
if (!entry)
|
|
87
|
+
throw new UnknownAliasError(alias);
|
|
88
|
+
const now = (ctx.now ?? (() => new Date()))();
|
|
89
|
+
const events = [];
|
|
90
|
+
if (entry.removedAt) {
|
|
91
|
+
const removedAt = new Date(entry.removedAt);
|
|
92
|
+
if (now.getTime() >= removedAt.getTime()) {
|
|
93
|
+
throw new ModelRemovedError(alias, entry.modelId, entry.removedAt);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (entry.deprecatedAt) {
|
|
97
|
+
const deprecatedAt = new Date(entry.deprecatedAt);
|
|
98
|
+
if (now.getTime() >= deprecatedAt.getTime()) {
|
|
99
|
+
events.push({
|
|
100
|
+
type: 'ModelDeprecated',
|
|
101
|
+
alias,
|
|
102
|
+
modelId: entry.modelId,
|
|
103
|
+
removedAt: entry.removedAt,
|
|
104
|
+
replacementAlias: entry.replacementAlias,
|
|
105
|
+
});
|
|
106
|
+
if (entry.removedAt) {
|
|
107
|
+
const removedAt = new Date(entry.removedAt);
|
|
108
|
+
const graceCutoff = removedAt.getTime() - GRACE_PERIOD_DAYS * 24 * 60 * 60 * 1000;
|
|
109
|
+
if (now.getTime() >= graceCutoff) {
|
|
110
|
+
events.push({
|
|
111
|
+
type: 'ModelDeprecationGracePeriod',
|
|
112
|
+
alias,
|
|
113
|
+
removedAt: entry.removedAt,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (events.length === 0) {
|
|
120
|
+
events.push({ type: 'ok', alias, modelId: entry.modelId });
|
|
121
|
+
}
|
|
122
|
+
return { modelId: entry.modelId, events };
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Bulk-resolve a set of stage aliases. Emits one ResolutionResult per (stage, alias).
|
|
126
|
+
* Used at pipeline-load to pin model resolution for the whole pipeline run.
|
|
127
|
+
*/
|
|
128
|
+
resolveAll(stageAliases, ctx = {}) {
|
|
129
|
+
const out = new Map();
|
|
130
|
+
for (const { stage, alias } of stageAliases) {
|
|
131
|
+
out.set(stage, this.resolve(alias, ctx));
|
|
132
|
+
}
|
|
133
|
+
return out;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Operator-facing dry-run helper: for each currently deprecated alias, report what
|
|
137
|
+
* would happen if a pipeline started today. Used by cli-model-bump --dry-run.
|
|
138
|
+
*/
|
|
139
|
+
bumpPlan(stageAliases, ctx = {}) {
|
|
140
|
+
const now = (ctx.now ?? (() => new Date()))();
|
|
141
|
+
const result = [];
|
|
142
|
+
for (const { stage, alias } of stageAliases) {
|
|
143
|
+
const entry = this.entries.get(alias);
|
|
144
|
+
if (!entry || !entry.deprecatedAt)
|
|
145
|
+
continue;
|
|
146
|
+
if (new Date(entry.deprecatedAt).getTime() > now.getTime())
|
|
147
|
+
continue;
|
|
148
|
+
let replacementModelId = null;
|
|
149
|
+
if (entry.replacementAlias) {
|
|
150
|
+
const replacement = this.entries.get(entry.replacementAlias);
|
|
151
|
+
replacementModelId = replacement?.modelId ?? null;
|
|
152
|
+
}
|
|
153
|
+
let inGracePeriod = false;
|
|
154
|
+
if (entry.removedAt) {
|
|
155
|
+
const removedAt = new Date(entry.removedAt);
|
|
156
|
+
const graceCutoff = removedAt.getTime() - GRACE_PERIOD_DAYS * 24 * 60 * 60 * 1000;
|
|
157
|
+
inGracePeriod = now.getTime() >= graceCutoff;
|
|
158
|
+
}
|
|
159
|
+
result.push({
|
|
160
|
+
stage,
|
|
161
|
+
alias,
|
|
162
|
+
currentModelId: entry.modelId,
|
|
163
|
+
deprecatedAt: entry.deprecatedAt,
|
|
164
|
+
removedAt: entry.removedAt,
|
|
165
|
+
replacementAlias: entry.replacementAlias,
|
|
166
|
+
replacementModelId,
|
|
167
|
+
inGracePeriod,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pillar breakdown & tension detection (RFC-0008 §A.6 + Amendment 6).
|
|
3
|
+
*
|
|
4
|
+
* The admission composite produces a single scalar, but downstream
|
|
5
|
+
* reviewers (product, design, engineering) want to see *which pillar*
|
|
6
|
+
* the score came from — so they can act on a mismatch between a
|
|
7
|
+
* strong product signal and a weak design or engineering one.
|
|
8
|
+
*
|
|
9
|
+
* This module takes the `AdmissionComposite.breakdown` emitted by
|
|
10
|
+
* `computeAdmissionComposite` and produces:
|
|
11
|
+
* - three `PillarContribution`s (product/design/engineering)
|
|
12
|
+
* - `SharedDimensions` (SA-3 placeholder + HC channel map)
|
|
13
|
+
* - tension flags detected from pillar mismatch
|
|
14
|
+
*/
|
|
15
|
+
import type { AdmissionComposite } from './admission-composite.js';
|
|
16
|
+
export type PillarName = 'product' | 'design' | 'engineering';
|
|
17
|
+
export type TensionFlagType = 'PRODUCT_HIGH_DESIGN_LOW' | 'PRODUCT_HIGH_ENGINEERING_LOW' | 'DESIGN_HIGH_PRODUCT_LOW' | 'ENGINEERING_HIGH_PRODUCT_LOW' | 'ALL_MEDIUM';
|
|
18
|
+
export interface PillarContribution {
|
|
19
|
+
pillar: PillarName;
|
|
20
|
+
/** PPA/RFC dimension labels attributed to this pillar at admission time. */
|
|
21
|
+
governedDimensions: string[];
|
|
22
|
+
/** Aggregate pillar signal in [0, 1]. */
|
|
23
|
+
signal: number;
|
|
24
|
+
/** Stable human-readable interpretation (snapshot-tested). */
|
|
25
|
+
interpretation: string;
|
|
26
|
+
}
|
|
27
|
+
export interface HcChannelBreakdown {
|
|
28
|
+
explicit: number;
|
|
29
|
+
consensus: number;
|
|
30
|
+
decision: number;
|
|
31
|
+
design: number;
|
|
32
|
+
}
|
|
33
|
+
export interface SharedDimensions {
|
|
34
|
+
/**
|
|
35
|
+
* SA-3 (shared intent) — unavailable at admission in Phase 1; M5
|
|
36
|
+
* populates this once the SA-1/SA-2/SA-3 decomposition lands.
|
|
37
|
+
*/
|
|
38
|
+
saAlpha3?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Per-channel HC breakdown with the tanh composite for reference.
|
|
41
|
+
*
|
|
42
|
+
* `designAuthorityConfigured` (AISDLC-171) — diagnostic flag set when
|
|
43
|
+
* the resolved DSB declares any `stewardship.designAuthority.principals`
|
|
44
|
+
* entries, regardless of whether one of them participated in the issue.
|
|
45
|
+
* Lets operators distinguish three pillarBreakdown states for the design
|
|
46
|
+
* channel:
|
|
47
|
+
* - `design = 0` and `configured === undefined` → no DSB resolved
|
|
48
|
+
* (preDesignSystem). HC_design intentionally inert.
|
|
49
|
+
* - `design = 0` and `configured === true` → DSB declares design
|
|
50
|
+
* authority but no principal participated as author/commenter.
|
|
51
|
+
* HC_design intentionally 0 per RFC-0008 §14.2 (only principals
|
|
52
|
+
* emit full-weight HC_design signals; non-principal opinions route
|
|
53
|
+
* through HC_consensus, not HC_design).
|
|
54
|
+
* - `design ≠ 0` and `configured === true` → a principal
|
|
55
|
+
* participated; signal weight reflects label-derived signalType.
|
|
56
|
+
*
|
|
57
|
+
* The `false` case (DSB exists but `principals` is empty) is also
|
|
58
|
+
* surfaced for completeness — a DSB without designAuthority principals
|
|
59
|
+
* cannot ever fire HC_design and operators should know.
|
|
60
|
+
*/
|
|
61
|
+
hcComposite: HcChannelBreakdown & {
|
|
62
|
+
value: number;
|
|
63
|
+
designAuthorityConfigured?: boolean;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export interface TensionFlag {
|
|
67
|
+
type: TensionFlagType;
|
|
68
|
+
/** Stable suggestion string per tension type (snapshot-tested). */
|
|
69
|
+
suggestedAction: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PillarBreakdown {
|
|
72
|
+
product: PillarContribution;
|
|
73
|
+
design: PillarContribution;
|
|
74
|
+
engineering: PillarContribution;
|
|
75
|
+
shared: SharedDimensions;
|
|
76
|
+
tensions: TensionFlag[];
|
|
77
|
+
}
|
|
78
|
+
export declare function computePillarBreakdown(composite: AdmissionComposite): PillarBreakdown;
|
|
79
|
+
export declare function detectTensions(breakdown: PillarBreakdown): TensionFlag[];
|
|
80
|
+
/**
|
|
81
|
+
* Aggregate pillar signal in [0, 1]. Exposed so consumers can compute
|
|
82
|
+
* pillar scores without needing the full `AdmissionComposite`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function pillarSignalScore(signals: readonly number[]): number;
|
|
85
|
+
//# sourceMappingURL=pillar-breakdown.d.ts.map
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pillar breakdown & tension detection (RFC-0008 §A.6 + Amendment 6).
|
|
3
|
+
*
|
|
4
|
+
* The admission composite produces a single scalar, but downstream
|
|
5
|
+
* reviewers (product, design, engineering) want to see *which pillar*
|
|
6
|
+
* the score came from — so they can act on a mismatch between a
|
|
7
|
+
* strong product signal and a weak design or engineering one.
|
|
8
|
+
*
|
|
9
|
+
* This module takes the `AdmissionComposite.breakdown` emitted by
|
|
10
|
+
* `computeAdmissionComposite` and produces:
|
|
11
|
+
* - three `PillarContribution`s (product/design/engineering)
|
|
12
|
+
* - `SharedDimensions` (SA-3 placeholder + HC channel map)
|
|
13
|
+
* - tension flags detected from pillar mismatch
|
|
14
|
+
*/
|
|
15
|
+
// ── Thresholds ─────────────────────────────────────────────────────────
|
|
16
|
+
const HIGH_THRESHOLD = 0.7;
|
|
17
|
+
const LOW_THRESHOLD = 0.3;
|
|
18
|
+
const MEDIUM_LOW = 0.3;
|
|
19
|
+
const MEDIUM_HIGH = 0.5;
|
|
20
|
+
// ── Suggested actions (stable) ─────────────────────────────────────────
|
|
21
|
+
const SUGGESTED_ACTIONS = Object.freeze({
|
|
22
|
+
PRODUCT_HIGH_DESIGN_LOW: 'Product intent is strong but design-system readiness is weak; consider catalog-first work or route through design authority before building.',
|
|
23
|
+
PRODUCT_HIGH_ENGINEERING_LOW: 'Product intent is strong but engineering signal is weak; address the defect-density, autonomy gap, or complexity before building.',
|
|
24
|
+
DESIGN_HIGH_PRODUCT_LOW: 'Design signal is strong but product demand is low; confirm product alignment before scheduling.',
|
|
25
|
+
ENGINEERING_HIGH_PRODUCT_LOW: 'Engineering area health is strong but product demand is weak; surface more demand evidence before scheduling.',
|
|
26
|
+
ALL_MEDIUM: 'All pillars are in the neutral band; the score is likely noise — gather more evidence or defer.',
|
|
27
|
+
});
|
|
28
|
+
// ── Public API ─────────────────────────────────────────────────────────
|
|
29
|
+
export function computePillarBreakdown(composite) {
|
|
30
|
+
const b = composite.breakdown;
|
|
31
|
+
// Product: SA-1 (soulAlignment proxy), D-pi, HC_explicit
|
|
32
|
+
const productSignal = mean([
|
|
33
|
+
b.soulAlignment,
|
|
34
|
+
b.demandPressureAdjusted,
|
|
35
|
+
normalizeSigned(b.humanCurve.hcExplicit),
|
|
36
|
+
]);
|
|
37
|
+
const product = {
|
|
38
|
+
pillar: 'product',
|
|
39
|
+
governedDimensions: ['SA-1', 'D-pi', 'HC_explicit'],
|
|
40
|
+
signal: productSignal,
|
|
41
|
+
interpretation: interpret('Product', productSignal, 'mission alignment, demand, and explicit priority'),
|
|
42
|
+
};
|
|
43
|
+
// Design: ER-4 (designSystemReadiness) + HC_design; SA-2 deferred to M5.
|
|
44
|
+
const designSignal = mean([b.designSystemReadiness, normalizeSigned(b.humanCurve.hcDesign)]);
|
|
45
|
+
const design = {
|
|
46
|
+
pillar: 'design',
|
|
47
|
+
governedDimensions: ['ER-4', 'HC_design'],
|
|
48
|
+
signal: designSignal,
|
|
49
|
+
interpretation: interpret('Design', designSignal, 'design-system readiness and design-authority signal'),
|
|
50
|
+
};
|
|
51
|
+
// Engineering: ER-1 (baseER), ER-2 (autonomyFactor), defectRiskFactor inverse.
|
|
52
|
+
// defectRiskFactor is clamped upstream to [0, 0.5]; the clamp01 here is
|
|
53
|
+
// a defence-in-depth guard so a regression in the upstream clamp can't
|
|
54
|
+
// feed a negative value into `mean()` and corrupt the engineering signal.
|
|
55
|
+
const engineeringSignal = mean([
|
|
56
|
+
b.baseExecutionReality,
|
|
57
|
+
b.autonomyFactor,
|
|
58
|
+
clamp01(1 - 2 * b.defectRiskFactor),
|
|
59
|
+
]);
|
|
60
|
+
const engineering = {
|
|
61
|
+
pillar: 'engineering',
|
|
62
|
+
governedDimensions: ['ER-1', 'ER-2', 'ER-3'],
|
|
63
|
+
signal: engineeringSignal,
|
|
64
|
+
interpretation: interpret('Engineering', engineeringSignal, 'complexity feasibility, autonomy gap, and code-area defect risk'),
|
|
65
|
+
};
|
|
66
|
+
const shared = {
|
|
67
|
+
hcComposite: {
|
|
68
|
+
explicit: b.humanCurve.hcExplicit,
|
|
69
|
+
consensus: b.humanCurve.hcConsensus,
|
|
70
|
+
decision: b.humanCurve.hcDecision,
|
|
71
|
+
design: b.humanCurve.hcDesign,
|
|
72
|
+
value: b.humanCurve.hcComposite,
|
|
73
|
+
// AISDLC-171: only include the flag when the underlying signal
|
|
74
|
+
// populated it (i.e., a DSB was resolved). Leaving it `undefined`
|
|
75
|
+
// when no DSB was supplied keeps the preDesignSystem state
|
|
76
|
+
// distinct from the "configured but inactive" state at the API
|
|
77
|
+
// surface — operators inspecting `pillarBreakdown.shared` can
|
|
78
|
+
// tell the three states apart without reading the DSB themselves.
|
|
79
|
+
...(b.humanCurve.designAuthorityConfigured !== undefined
|
|
80
|
+
? { designAuthorityConfigured: b.humanCurve.designAuthorityConfigured }
|
|
81
|
+
: {}),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
const tensions = detectTensions({ product, design, engineering, shared, tensions: [] });
|
|
85
|
+
return { product, design, engineering, shared, tensions };
|
|
86
|
+
}
|
|
87
|
+
export function detectTensions(breakdown) {
|
|
88
|
+
const flags = [];
|
|
89
|
+
const p = breakdown.product.signal;
|
|
90
|
+
const d = breakdown.design.signal;
|
|
91
|
+
const e = breakdown.engineering.signal;
|
|
92
|
+
if (p > HIGH_THRESHOLD && d < LOW_THRESHOLD) {
|
|
93
|
+
flags.push({
|
|
94
|
+
type: 'PRODUCT_HIGH_DESIGN_LOW',
|
|
95
|
+
suggestedAction: SUGGESTED_ACTIONS.PRODUCT_HIGH_DESIGN_LOW,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (p > HIGH_THRESHOLD && e < LOW_THRESHOLD) {
|
|
99
|
+
flags.push({
|
|
100
|
+
type: 'PRODUCT_HIGH_ENGINEERING_LOW',
|
|
101
|
+
suggestedAction: SUGGESTED_ACTIONS.PRODUCT_HIGH_ENGINEERING_LOW,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (d > HIGH_THRESHOLD && p < LOW_THRESHOLD) {
|
|
105
|
+
flags.push({
|
|
106
|
+
type: 'DESIGN_HIGH_PRODUCT_LOW',
|
|
107
|
+
suggestedAction: SUGGESTED_ACTIONS.DESIGN_HIGH_PRODUCT_LOW,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (e > HIGH_THRESHOLD && p < LOW_THRESHOLD) {
|
|
111
|
+
flags.push({
|
|
112
|
+
type: 'ENGINEERING_HIGH_PRODUCT_LOW',
|
|
113
|
+
suggestedAction: SUGGESTED_ACTIONS.ENGINEERING_HIGH_PRODUCT_LOW,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// ALL_MEDIUM: all three pillars strictly inside [MEDIUM_LOW, MEDIUM_HIGH]
|
|
117
|
+
if (inMediumBand(p) && inMediumBand(d) && inMediumBand(e)) {
|
|
118
|
+
flags.push({
|
|
119
|
+
type: 'ALL_MEDIUM',
|
|
120
|
+
suggestedAction: SUGGESTED_ACTIONS.ALL_MEDIUM,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return flags;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Aggregate pillar signal in [0, 1]. Exposed so consumers can compute
|
|
127
|
+
* pillar scores without needing the full `AdmissionComposite`.
|
|
128
|
+
*/
|
|
129
|
+
export function pillarSignalScore(signals) {
|
|
130
|
+
return mean(signals);
|
|
131
|
+
}
|
|
132
|
+
// ── Helpers ────────────────────────────────────────────────────────────
|
|
133
|
+
function mean(values) {
|
|
134
|
+
if (values.length === 0)
|
|
135
|
+
return 0;
|
|
136
|
+
const sum = values.reduce((acc, v) => acc + v, 0);
|
|
137
|
+
return clamp01(sum / values.length);
|
|
138
|
+
}
|
|
139
|
+
function clamp01(value) {
|
|
140
|
+
return Math.min(1, Math.max(0, value));
|
|
141
|
+
}
|
|
142
|
+
/** Map a signed [-1, 1] HC channel onto the pillar's unsigned [0, 1] scale. */
|
|
143
|
+
function normalizeSigned(value) {
|
|
144
|
+
return clamp01((value + 1) / 2);
|
|
145
|
+
}
|
|
146
|
+
function interpret(pillar, signal, what) {
|
|
147
|
+
const band = signalBand(signal);
|
|
148
|
+
return `${band} ${pillar} signal (${signal.toFixed(2)}) from ${what}`;
|
|
149
|
+
}
|
|
150
|
+
function signalBand(signal) {
|
|
151
|
+
if (signal >= HIGH_THRESHOLD)
|
|
152
|
+
return 'strong';
|
|
153
|
+
if (signal >= MEDIUM_HIGH)
|
|
154
|
+
return 'moderate';
|
|
155
|
+
if (signal >= MEDIUM_LOW)
|
|
156
|
+
return 'neutral';
|
|
157
|
+
return 'weak';
|
|
158
|
+
}
|
|
159
|
+
function inMediumBand(value) {
|
|
160
|
+
return value >= MEDIUM_LOW && value <= MEDIUM_HIGH;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=pillar-breakdown.js.map
|
package/dist/priority.d.ts
CHANGED
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import type { PriorityScore, PriorityInput, PriorityConfig } from '@ai-sdlc/reference';
|
|
14
14
|
export type { PriorityScore, PriorityInput, PriorityConfig };
|
|
15
|
+
/**
|
|
16
|
+
* Compute a confidence score [0, 1] based on the fraction of optional
|
|
17
|
+
* input fields that were explicitly provided (not defaulted).
|
|
18
|
+
*/
|
|
19
|
+
export declare function computeConfidence(input: PriorityInput): number;
|
|
15
20
|
/**
|
|
16
21
|
* Compute the PPA composite priority score for a single work item.
|
|
17
22
|
*
|
package/dist/priority.js
CHANGED
|
@@ -132,10 +132,23 @@ function computeHumanCurve(input, weights) {
|
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Cκ — Calibration Coefficient [0.7, 1.3].
|
|
135
|
-
*
|
|
135
|
+
*
|
|
136
|
+
* Category-scoped (RFC-0008 §10 Amendment 6) when `categoryResolver`
|
|
137
|
+
* and `categoryCoefficients` are both present: resolver returns a
|
|
138
|
+
* category label, coefficient is looked up, scalar fallback applies
|
|
139
|
+
* when the category has no entry. Otherwise uses the scalar path
|
|
140
|
+
* unchanged.
|
|
136
141
|
*/
|
|
137
|
-
function computeCalibration(config) {
|
|
138
|
-
|
|
142
|
+
function computeCalibration(input, config) {
|
|
143
|
+
let coeff = config?.calibrationCoefficient ?? 1.0;
|
|
144
|
+
const resolver = config?.categoryResolver;
|
|
145
|
+
const table = config?.categoryCoefficients;
|
|
146
|
+
if (resolver && table) {
|
|
147
|
+
const category = resolver(input);
|
|
148
|
+
if (category && table[category] !== undefined) {
|
|
149
|
+
coeff = table[category];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
139
152
|
return clamp(coeff, CALIBRATION_MIN, CALIBRATION_MAX);
|
|
140
153
|
}
|
|
141
154
|
// ── Confidence ──────────────────────────────────────────────────────
|
|
@@ -143,7 +156,7 @@ function computeCalibration(config) {
|
|
|
143
156
|
* Compute a confidence score [0, 1] based on the fraction of optional
|
|
144
157
|
* input fields that were explicitly provided (not defaulted).
|
|
145
158
|
*/
|
|
146
|
-
function computeConfidence(input) {
|
|
159
|
+
export function computeConfidence(input) {
|
|
147
160
|
let provided = 0;
|
|
148
161
|
for (const field of SCORABLE_FIELDS) {
|
|
149
162
|
if (input[field] !== undefined) {
|
|
@@ -194,7 +207,7 @@ export function computePriority(input, config) {
|
|
|
194
207
|
const executionReality = computeExecutionReality(input);
|
|
195
208
|
const entropyTax = computeEntropyTax(input);
|
|
196
209
|
const humanCurve = computeHumanCurve(input, hcWeights);
|
|
197
|
-
const calibration = computeCalibration(config);
|
|
210
|
+
const calibration = computeCalibration(input, config);
|
|
198
211
|
// ── Composite ─────────────────────────────────────────────────
|
|
199
212
|
const composite = soulAlignment *
|
|
200
213
|
demandPressure *
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta-review pass — filters medium-confidence findings through a
|
|
3
|
+
* lightweight LLM call (Haiku) to reduce false positives.
|
|
4
|
+
*
|
|
5
|
+
* Flow:
|
|
6
|
+
* High confidence (>0.8) → post directly
|
|
7
|
+
* Medium (0.5-0.8) → meta-review decides keep/drop
|
|
8
|
+
* Low (<0.5) → already suppressed by parseVerdict()
|
|
9
|
+
*/
|
|
10
|
+
import type { ReviewVerdict, ReviewFinding } from './runners/review-agent.js';
|
|
11
|
+
export interface MetaReviewDecision {
|
|
12
|
+
keep: boolean;
|
|
13
|
+
adjustedSeverity?: ReviewFinding['severity'];
|
|
14
|
+
reason: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MetaReviewResult {
|
|
17
|
+
/** The filtered verdict with medium-confidence findings reviewed. */
|
|
18
|
+
verdict: ReviewVerdict;
|
|
19
|
+
/** Decisions for each medium-confidence finding. */
|
|
20
|
+
decisions: Array<{
|
|
21
|
+
finding: ReviewFinding;
|
|
22
|
+
decision: MetaReviewDecision;
|
|
23
|
+
}>;
|
|
24
|
+
/** Count of findings suppressed by meta-review. */
|
|
25
|
+
suppressed: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Run a meta-review pass on medium-confidence findings.
|
|
29
|
+
*
|
|
30
|
+
* @param verdict - The original verdict from a review agent
|
|
31
|
+
* @param principles - Review principles text for context
|
|
32
|
+
* @param callLLM - Function to make a single-turn LLM call (injectable for testing)
|
|
33
|
+
*/
|
|
34
|
+
export declare function metaReview(verdict: ReviewVerdict, principles: string, callLLM: (prompt: string) => Promise<string>): Promise<MetaReviewResult>;
|
|
35
|
+
export interface ReviewFeedback {
|
|
36
|
+
/** PR number. */
|
|
37
|
+
prNumber: number;
|
|
38
|
+
/** Finding that was posted. */
|
|
39
|
+
finding: ReviewFinding;
|
|
40
|
+
/** Human response. */
|
|
41
|
+
signal: 'accepted' | 'dismissed' | 'ignored';
|
|
42
|
+
/** Timestamp. */
|
|
43
|
+
timestamp: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Store for tracking human feedback on review findings.
|
|
47
|
+
* Used to calibrate confidence thresholds over time.
|
|
48
|
+
*/
|
|
49
|
+
export declare class ReviewFeedbackStore {
|
|
50
|
+
private entries;
|
|
51
|
+
record(feedback: ReviewFeedback): void;
|
|
52
|
+
/** Get all feedback entries. */
|
|
53
|
+
getAll(): ReviewFeedback[];
|
|
54
|
+
/** Get precision: accepted / (accepted + dismissed). */
|
|
55
|
+
precision(): number;
|
|
56
|
+
/** Get feedback by category. */
|
|
57
|
+
byCategory(): Record<string, {
|
|
58
|
+
accepted: number;
|
|
59
|
+
dismissed: number;
|
|
60
|
+
ignored: number;
|
|
61
|
+
}>;
|
|
62
|
+
/** Categories with high false-positive rate (dismissed > 50%). */
|
|
63
|
+
highFalsePositiveCategories(): string[];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=review-meta.d.ts.map
|