@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,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermetic git env for orchestrator test fixtures (AISDLC-257).
|
|
3
|
+
*
|
|
4
|
+
* Cross-link: mirrors `pipeline-cli/src/__test-helpers/git-env.ts` (AISDLC-253).
|
|
5
|
+
* See that file for the canonical rationale. This copy exists so orchestrator
|
|
6
|
+
* tests don't take a cross-package import dependency on pipeline-cli's test
|
|
7
|
+
* helpers.
|
|
8
|
+
*
|
|
9
|
+
* Why this exists
|
|
10
|
+
* ───────────────
|
|
11
|
+
* Test fixtures that shell out to `git` (e.g. `execSync('git init', { cwd: d })`)
|
|
12
|
+
* are vulnerable to env-var bleed from the parent shell:
|
|
13
|
+
*
|
|
14
|
+
* - `GIT_DIR=...` overrides cwd-based repo discovery — every git command
|
|
15
|
+
* writes into the parent shell's GIT_DIR, NOT the fixture's `cwd`.
|
|
16
|
+
* - `GIT_WORK_TREE=...` ditto for the working tree.
|
|
17
|
+
* - `core.hooksPath` from system/global config can fire husky hooks during
|
|
18
|
+
* fixture commits.
|
|
19
|
+
* - `commit.gpgsign=true` from operator config can break unattended commits.
|
|
20
|
+
*
|
|
21
|
+
* The `cleanGitEnv()` helper in `orchestrator/src/runtime/git-env.ts` strips
|
|
22
|
+
* GIT_DIR / GIT_WORK_TREE / GIT_INDEX_FILE but still inherits `process.env`
|
|
23
|
+
* in full, meaning `git config user.email` writes still land wherever git
|
|
24
|
+
* resolves config (which may be a polluted GIT_DIR or the operator's global
|
|
25
|
+
* config). AISDLC-257 identified `worktree-pool.integration.test.ts` as the
|
|
26
|
+
* confirmed leak source.
|
|
27
|
+
*
|
|
28
|
+
* `makeGitEnv()` uses an ALLOW-LIST approach rather than a DENY-LIST: it
|
|
29
|
+
* constructs a minimal env from scratch, deliberately omitting GIT_DIR and
|
|
30
|
+
* GIT_WORK_TREE. Identity is provided via `GIT_AUTHOR_*` / `GIT_COMMITTER_*`
|
|
31
|
+
* env vars so fixtures never need `git config user.email`.
|
|
32
|
+
*
|
|
33
|
+
* Pattern (matches pipeline-cli AISDLC-253 + orchestrator AISDLC-241/246):
|
|
34
|
+
*
|
|
35
|
+
* const env = makeGitEnv();
|
|
36
|
+
* execSync('git init -b main', { cwd: repoDir, env, stdio: 'pipe' });
|
|
37
|
+
* // No `git config user.email` needed — identity comes from GIT_AUTHOR_*
|
|
38
|
+
*/
|
|
39
|
+
export declare function makeGitEnv(): NodeJS.ProcessEnv;
|
|
40
|
+
//# sourceMappingURL=git-env.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hermetic git env for orchestrator test fixtures (AISDLC-257).
|
|
3
|
+
*
|
|
4
|
+
* Cross-link: mirrors `pipeline-cli/src/__test-helpers/git-env.ts` (AISDLC-253).
|
|
5
|
+
* See that file for the canonical rationale. This copy exists so orchestrator
|
|
6
|
+
* tests don't take a cross-package import dependency on pipeline-cli's test
|
|
7
|
+
* helpers.
|
|
8
|
+
*
|
|
9
|
+
* Why this exists
|
|
10
|
+
* ───────────────
|
|
11
|
+
* Test fixtures that shell out to `git` (e.g. `execSync('git init', { cwd: d })`)
|
|
12
|
+
* are vulnerable to env-var bleed from the parent shell:
|
|
13
|
+
*
|
|
14
|
+
* - `GIT_DIR=...` overrides cwd-based repo discovery — every git command
|
|
15
|
+
* writes into the parent shell's GIT_DIR, NOT the fixture's `cwd`.
|
|
16
|
+
* - `GIT_WORK_TREE=...` ditto for the working tree.
|
|
17
|
+
* - `core.hooksPath` from system/global config can fire husky hooks during
|
|
18
|
+
* fixture commits.
|
|
19
|
+
* - `commit.gpgsign=true` from operator config can break unattended commits.
|
|
20
|
+
*
|
|
21
|
+
* The `cleanGitEnv()` helper in `orchestrator/src/runtime/git-env.ts` strips
|
|
22
|
+
* GIT_DIR / GIT_WORK_TREE / GIT_INDEX_FILE but still inherits `process.env`
|
|
23
|
+
* in full, meaning `git config user.email` writes still land wherever git
|
|
24
|
+
* resolves config (which may be a polluted GIT_DIR or the operator's global
|
|
25
|
+
* config). AISDLC-257 identified `worktree-pool.integration.test.ts` as the
|
|
26
|
+
* confirmed leak source.
|
|
27
|
+
*
|
|
28
|
+
* `makeGitEnv()` uses an ALLOW-LIST approach rather than a DENY-LIST: it
|
|
29
|
+
* constructs a minimal env from scratch, deliberately omitting GIT_DIR and
|
|
30
|
+
* GIT_WORK_TREE. Identity is provided via `GIT_AUTHOR_*` / `GIT_COMMITTER_*`
|
|
31
|
+
* env vars so fixtures never need `git config user.email`.
|
|
32
|
+
*
|
|
33
|
+
* Pattern (matches pipeline-cli AISDLC-253 + orchestrator AISDLC-241/246):
|
|
34
|
+
*
|
|
35
|
+
* const env = makeGitEnv();
|
|
36
|
+
* execSync('git init -b main', { cwd: repoDir, env, stdio: 'pipe' });
|
|
37
|
+
* // No `git config user.email` needed — identity comes from GIT_AUTHOR_*
|
|
38
|
+
*/
|
|
39
|
+
export function makeGitEnv() {
|
|
40
|
+
return {
|
|
41
|
+
// Minimal OS plumbing.
|
|
42
|
+
PATH: process.env['PATH'] ?? '/usr/bin:/bin',
|
|
43
|
+
HOME: process.env['HOME'] ?? '/tmp',
|
|
44
|
+
...(process.env['TMPDIR'] ? { TMPDIR: process.env['TMPDIR'] } : {}),
|
|
45
|
+
...(process.env['TEMP'] ? { TEMP: process.env['TEMP'] } : {}),
|
|
46
|
+
...(process.env['TMP'] ? { TMP: process.env['TMP'] } : {}),
|
|
47
|
+
// Locale — prevent non-ASCII error strings in git output.
|
|
48
|
+
LANG: process.env['LANG'] ?? 'en_US.UTF-8',
|
|
49
|
+
LC_ALL: 'C',
|
|
50
|
+
// Git identity — supplied via env so `git config user.email/user.name`
|
|
51
|
+
// is never needed inside the fixture (those writes would land in either
|
|
52
|
+
// the fixture's .git/config or, if GIT_DIR is polluted, in the host
|
|
53
|
+
// worktree's config).
|
|
54
|
+
GIT_AUTHOR_NAME: 'Test',
|
|
55
|
+
GIT_AUTHOR_EMAIL: 'test@test.invalid',
|
|
56
|
+
GIT_COMMITTER_NAME: 'Test',
|
|
57
|
+
GIT_COMMITTER_EMAIL: 'test@test.invalid',
|
|
58
|
+
// Disable system + global git config to prevent gpgsign / hookPath /
|
|
59
|
+
// user-config bleed from the operator's machine.
|
|
60
|
+
GIT_CONFIG_NOSYSTEM: '1',
|
|
61
|
+
GIT_CONFIG_GLOBAL: '/dev/null',
|
|
62
|
+
// Disable husky so the calling project's pre-commit hooks don't fire.
|
|
63
|
+
HUSKY: '0',
|
|
64
|
+
// Suppress credential helpers / interactive prompts.
|
|
65
|
+
GIT_TERMINAL_PROMPT: '0',
|
|
66
|
+
GIT_SSH_COMMAND: 'ssh -o BatchMode=yes',
|
|
67
|
+
// Note: deliberately NO `GIT_DIR` / `GIT_WORK_TREE` keys — by omitting
|
|
68
|
+
// them from the returned object, child processes inherit nothing for
|
|
69
|
+
// those vars (the env REPLACES the parent's env when passed to execSync,
|
|
70
|
+
// it doesn't merge). That's the load-bearing guarantee against the leak.
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=git-env.js.map
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission-subset composite (RFC-0008 §A.6).
|
|
3
|
+
*
|
|
4
|
+
* The admission gate uses a subset of the full PPA composite:
|
|
5
|
+
*
|
|
6
|
+
* P_admission = SA × D-pi_adjusted × ER × (1 + HC)
|
|
7
|
+
*
|
|
8
|
+
* where:
|
|
9
|
+
* SA = soulAlignment (0–1)
|
|
10
|
+
* D-pi_adjusted = rawDP × (1 − defectRiskFactor)
|
|
11
|
+
* rawDP = (demand + consensus + conviction + drift) / 4
|
|
12
|
+
* ER = min(baseER × autonomyFactor, designSystemReadiness)
|
|
13
|
+
* baseER = 1 − complexity / 10
|
|
14
|
+
* HC = tanh(weighted sum — see §A.6 Amendment 4)
|
|
15
|
+
*
|
|
16
|
+
* M-phi, E-tau, C-kappa are **deferred to runtime scoring** (§A.6 table):
|
|
17
|
+
* they apply once the issue is admitted and picked up by an executor,
|
|
18
|
+
* not at the admission gate. To keep the returned `PriorityScore`
|
|
19
|
+
* shape consistent with downstream consumers, we fill those dimensions
|
|
20
|
+
* with neutral values: marketForce=1, entropyTax=0, calibration=1
|
|
21
|
+
* (or the configured calibration coefficient if supplied, for display).
|
|
22
|
+
*
|
|
23
|
+
* The `override` bypass is preserved at position 1: when the input has
|
|
24
|
+
* `override: true`, we return `composite = Infinity` without running
|
|
25
|
+
* the admission math — identical to the legacy PPA behaviour.
|
|
26
|
+
*/
|
|
27
|
+
import type { PriorityConfig, PriorityInput, PriorityScore } from '@ai-sdlc/reference';
|
|
28
|
+
import type { AdmissionInput } from './admission-score.js';
|
|
29
|
+
import { type AdmissionHumanCurveResult } from './admission-hc.js';
|
|
30
|
+
/**
|
|
31
|
+
* Result of the admission composite — returns a `PriorityScore`
|
|
32
|
+
* (backward-compatible with `scoreIssueForAdmission` consumers) plus
|
|
33
|
+
* the admission-specific breakdown for auditability.
|
|
34
|
+
*/
|
|
35
|
+
export interface AdmissionComposite {
|
|
36
|
+
score: PriorityScore;
|
|
37
|
+
breakdown: {
|
|
38
|
+
soulAlignment: number;
|
|
39
|
+
rawDemandPressure: number;
|
|
40
|
+
defectRiskFactor: number;
|
|
41
|
+
demandPressureAdjusted: number;
|
|
42
|
+
baseExecutionReality: number;
|
|
43
|
+
autonomyFactor: number;
|
|
44
|
+
designSystemReadiness: number;
|
|
45
|
+
executionReality: number;
|
|
46
|
+
humanCurve: AdmissionHumanCurveResult;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface AdmissionCompositeOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Optional override for the soulAlignment dimension — when present
|
|
52
|
+
* (typically a Phase 2b/2c/3 SA-1 from `scoreSoulAlignment`), it
|
|
53
|
+
* replaces the label-based heuristic. In Phase 2a shadow mode,
|
|
54
|
+
* callers pass undefined and the label-based fallback applies.
|
|
55
|
+
*/
|
|
56
|
+
soulAlignmentOverride?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Partial PriorityInput overrides applied AFTER `mapIssueToPriorityInput`.
|
|
59
|
+
* Used by non-GitHub trackers (e.g. Backlog.md adapter) to inject
|
|
60
|
+
* tracker-specific signals — `priority:p*` labels, AC-derived
|
|
61
|
+
* complexity, `qualityFlags` — that the GitHub-shaped mapper
|
|
62
|
+
* cannot extract. Only fields with defined values overwrite.
|
|
63
|
+
*/
|
|
64
|
+
priorityInputOverrides?: Partial<PriorityInput>;
|
|
65
|
+
}
|
|
66
|
+
export declare function computeAdmissionComposite(input: AdmissionInput, config?: PriorityConfig, options?: AdmissionCompositeOptions): AdmissionComposite;
|
|
67
|
+
/**
|
|
68
|
+
* Compute admission confidence in [0, 1] as a 50/50 blend of two
|
|
69
|
+
* independent evidence channels:
|
|
70
|
+
*
|
|
71
|
+
* 1. **Mapper coverage** — fraction of `ADMISSION_MAPPER_FIELDS`
|
|
72
|
+
* explicitly populated on the derived `PriorityInput`. Captures
|
|
73
|
+
* "how much issue/backlog signal did `mapIssueToPriorityInput`
|
|
74
|
+
* extract".
|
|
75
|
+
*
|
|
76
|
+
* 2. **Enrichment loaded** — fraction of RFC-0008 enrichment slots
|
|
77
|
+
* present on the input (or supplied via `options`). Captures "how
|
|
78
|
+
* much external context did the enrichment readers contribute".
|
|
79
|
+
*
|
|
80
|
+
* Bug fixed (AISDLC-172 / RFC-0009 §13 OQ-9): previously
|
|
81
|
+
* `computeConfidence(priorityInput)` from `priority.ts` was used, which
|
|
82
|
+
* counts against the full 16-field `SCORABLE_FIELDS` list and ignores
|
|
83
|
+
* enrichment success entirely. The result was a hard ~0.5 ceiling on
|
|
84
|
+
* admit confidence even when DID + DSB + maintainers + soul-tracks all
|
|
85
|
+
* loaded — those four positive observations contributed exactly zero
|
|
86
|
+
* to the formula's denominator and zero to its numerator.
|
|
87
|
+
*/
|
|
88
|
+
export declare function computeAdmissionConfidence(input: AdmissionInput, priorityInput: PriorityInput, options?: AdmissionCompositeOptions): number;
|
|
89
|
+
//# sourceMappingURL=admission-composite.d.ts.map
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admission-subset composite (RFC-0008 §A.6).
|
|
3
|
+
*
|
|
4
|
+
* The admission gate uses a subset of the full PPA composite:
|
|
5
|
+
*
|
|
6
|
+
* P_admission = SA × D-pi_adjusted × ER × (1 + HC)
|
|
7
|
+
*
|
|
8
|
+
* where:
|
|
9
|
+
* SA = soulAlignment (0–1)
|
|
10
|
+
* D-pi_adjusted = rawDP × (1 − defectRiskFactor)
|
|
11
|
+
* rawDP = (demand + consensus + conviction + drift) / 4
|
|
12
|
+
* ER = min(baseER × autonomyFactor, designSystemReadiness)
|
|
13
|
+
* baseER = 1 − complexity / 10
|
|
14
|
+
* HC = tanh(weighted sum — see §A.6 Amendment 4)
|
|
15
|
+
*
|
|
16
|
+
* M-phi, E-tau, C-kappa are **deferred to runtime scoring** (§A.6 table):
|
|
17
|
+
* they apply once the issue is admitted and picked up by an executor,
|
|
18
|
+
* not at the admission gate. To keep the returned `PriorityScore`
|
|
19
|
+
* shape consistent with downstream consumers, we fill those dimensions
|
|
20
|
+
* with neutral values: marketForce=1, entropyTax=0, calibration=1
|
|
21
|
+
* (or the configured calibration coefficient if supplied, for display).
|
|
22
|
+
*
|
|
23
|
+
* The `override` bypass is preserved at position 1: when the input has
|
|
24
|
+
* `override: true`, we return `composite = Infinity` without running
|
|
25
|
+
* the admission math — identical to the legacy PPA behaviour.
|
|
26
|
+
*/
|
|
27
|
+
import { mapIssueToPriorityInput } from './admission-score.js';
|
|
28
|
+
import { computeAutonomyFactor, computeDefectRiskFactor, computeReadinessFromDesignSystemContext, } from './admission-enrichment.js';
|
|
29
|
+
import { computeAdmissionHumanCurve } from './admission-hc.js';
|
|
30
|
+
const DEFAULT_SIGNAL = 0.5;
|
|
31
|
+
export function computeAdmissionComposite(input, config, options) {
|
|
32
|
+
const timestamp = new Date().toISOString();
|
|
33
|
+
const baseInput = mapIssueToPriorityInput(input);
|
|
34
|
+
const priorityInput = options?.priorityInputOverrides
|
|
35
|
+
? mergePriorityInputOverrides(baseInput, options.priorityInputOverrides)
|
|
36
|
+
: baseInput;
|
|
37
|
+
// ── Override path: position-1 bypass (§6 / AC #4) ─────────────
|
|
38
|
+
if (priorityInput.override) {
|
|
39
|
+
const score = {
|
|
40
|
+
composite: Infinity,
|
|
41
|
+
dimensions: {
|
|
42
|
+
soulAlignment: 1,
|
|
43
|
+
demandPressure: 1.5,
|
|
44
|
+
marketForce: 3.0,
|
|
45
|
+
executionReality: 1,
|
|
46
|
+
entropyTax: 0,
|
|
47
|
+
humanCurve: 1,
|
|
48
|
+
calibration: clampCalibration(config?.calibrationCoefficient),
|
|
49
|
+
},
|
|
50
|
+
confidence: 1,
|
|
51
|
+
timestamp,
|
|
52
|
+
override: {
|
|
53
|
+
reason: priorityInput.overrideReason ?? 'No reason provided',
|
|
54
|
+
expiry: priorityInput.overrideExpiry,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
score,
|
|
59
|
+
breakdown: {
|
|
60
|
+
soulAlignment: 1,
|
|
61
|
+
rawDemandPressure: 1,
|
|
62
|
+
defectRiskFactor: 0,
|
|
63
|
+
demandPressureAdjusted: 1,
|
|
64
|
+
baseExecutionReality: 1,
|
|
65
|
+
autonomyFactor: 1,
|
|
66
|
+
designSystemReadiness: 1,
|
|
67
|
+
executionReality: 1,
|
|
68
|
+
humanCurve: {
|
|
69
|
+
hcExplicit: 0,
|
|
70
|
+
hcConsensus: 0,
|
|
71
|
+
hcDecision: 0,
|
|
72
|
+
hcDesign: 0,
|
|
73
|
+
hcRaw: 0,
|
|
74
|
+
hcComposite: 1,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// ── SA (soul alignment) — SA-1 override (M5) or label-based fallback ──
|
|
80
|
+
const soulAlignment = clamp01(options?.soulAlignmentOverride ?? priorityInput.soulAlignment ?? DEFAULT_SIGNAL);
|
|
81
|
+
// ── D-pi_adjusted ─────────────────────────────────────────────
|
|
82
|
+
const demand = priorityInput.demandSignal ?? DEFAULT_SIGNAL;
|
|
83
|
+
const consensus = priorityInput.teamConsensus ?? DEFAULT_SIGNAL;
|
|
84
|
+
const conviction = priorityInput.builderConviction ?? DEFAULT_SIGNAL;
|
|
85
|
+
const drift = priorityInput.competitiveDrift ?? 0;
|
|
86
|
+
const rawDemandPressure = clamp01((demand + consensus + conviction + drift) / 4);
|
|
87
|
+
const defectRiskFactor = computeDefectRiskFactor(input.codeAreaQuality);
|
|
88
|
+
const demandPressureAdjusted = rawDemandPressure * (1 - defectRiskFactor);
|
|
89
|
+
// ── ER (execution reality) ─────────────────────────────────────
|
|
90
|
+
// baseER = 1 - complexity/10; complexity defaults to neutral midpoint.
|
|
91
|
+
const complexity = priorityInput.complexity ?? 5;
|
|
92
|
+
const baseExecutionReality = clamp01(1 - complexity / 10);
|
|
93
|
+
const autonomyFactor = computeAutonomyFactor(input.autonomyContext);
|
|
94
|
+
const designSystemReadiness = computeReadinessFromDesignSystemContext(input.designSystemContext);
|
|
95
|
+
const executionReality = Math.min(baseExecutionReality * autonomyFactor, designSystemReadiness);
|
|
96
|
+
// ── HC (tanh-compressed with HC_design) ───────────────────────
|
|
97
|
+
const humanCurve = computeAdmissionHumanCurve(input);
|
|
98
|
+
// ── §A.6 admission subset composite ───────────────────────────
|
|
99
|
+
const composite = soulAlignment * demandPressureAdjusted * executionReality * (1 + humanCurve.hcComposite);
|
|
100
|
+
const score = {
|
|
101
|
+
composite,
|
|
102
|
+
dimensions: {
|
|
103
|
+
soulAlignment,
|
|
104
|
+
demandPressure: demandPressureAdjusted,
|
|
105
|
+
// M-phi deferred to runtime — neutral for admission.
|
|
106
|
+
marketForce: 1,
|
|
107
|
+
executionReality,
|
|
108
|
+
// E-tau deferred to runtime — admission does not apply the
|
|
109
|
+
// entropy tax (competitiveDrift feeds rawDP instead).
|
|
110
|
+
entropyTax: 0,
|
|
111
|
+
humanCurve: humanCurve.hcComposite,
|
|
112
|
+
// C-kappa deferred to runtime — expose configured value for
|
|
113
|
+
// display continuity but do not multiply it into `composite`.
|
|
114
|
+
calibration: clampCalibration(config?.calibrationCoefficient),
|
|
115
|
+
},
|
|
116
|
+
confidence: computeAdmissionConfidence(input, priorityInput, options),
|
|
117
|
+
timestamp,
|
|
118
|
+
};
|
|
119
|
+
return {
|
|
120
|
+
score,
|
|
121
|
+
breakdown: {
|
|
122
|
+
soulAlignment,
|
|
123
|
+
rawDemandPressure,
|
|
124
|
+
defectRiskFactor,
|
|
125
|
+
demandPressureAdjusted,
|
|
126
|
+
baseExecutionReality,
|
|
127
|
+
autonomyFactor,
|
|
128
|
+
designSystemReadiness,
|
|
129
|
+
executionReality,
|
|
130
|
+
humanCurve,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// ── Admission confidence (AISDLC-172) ──────────────────────────────────
|
|
135
|
+
/**
|
|
136
|
+
* `PriorityInput` fields that the admission mapper (`mapIssueToPriorityInput`)
|
|
137
|
+
* actually populates from issue/backlog signals. The full PPA `SCORABLE_FIELDS`
|
|
138
|
+
* list (used by `computeConfidence` in `priority.ts`) includes runtime-only
|
|
139
|
+
* dimensions like `regulatoryUrgency`, `techInflection`, `marketDivergence`,
|
|
140
|
+
* `meetingDecision`, `budgetUtilization`, and `dependencyClearance` — none of
|
|
141
|
+
* which the admission mapper ever sets. Counting against the full 16-field
|
|
142
|
+
* list capped admit confidence at ~9/16 ≈ 0.56 even for fully-shaped issues
|
|
143
|
+
* (RFC-0009 §13 OQ-9 "0.5 ceiling" bug). The mapper-relevant subset is the
|
|
144
|
+
* correct denominator for the mapper-evidence half of the blend.
|
|
145
|
+
*/
|
|
146
|
+
const ADMISSION_MAPPER_FIELDS = [
|
|
147
|
+
'soulAlignment',
|
|
148
|
+
'demandSignal',
|
|
149
|
+
'teamConsensus',
|
|
150
|
+
'builderConviction',
|
|
151
|
+
'complexity',
|
|
152
|
+
'bugSeverity',
|
|
153
|
+
'explicitPriority',
|
|
154
|
+
'competitiveDrift',
|
|
155
|
+
'customerRequestCount',
|
|
156
|
+
];
|
|
157
|
+
/**
|
|
158
|
+
* RFC-0008 enrichment slots whose presence on `AdmissionInput` indicates
|
|
159
|
+
* an enrichment reader successfully loaded its context. This is the
|
|
160
|
+
* "enrichment-success signal" referenced in the OQ-9 hypothesis:
|
|
161
|
+
*
|
|
162
|
+
* - `designSystemContext` ← DSB loader (catalog/token coverage)
|
|
163
|
+
* - `autonomyContext` ← AutonomyPolicy (DID-driven) loader
|
|
164
|
+
* - `codeAreaQuality` ← code-area metrics loader
|
|
165
|
+
* - `designAuthoritySignal` ← maintainers/principals loader
|
|
166
|
+
* - `soulAlignmentOverride` ← soul-tracks SA-1 loader (M5 path)
|
|
167
|
+
*
|
|
168
|
+
* Total slots is `5`. Each loaded slot contributes `1/5` to the
|
|
169
|
+
* enrichment-evidence half of the confidence blend.
|
|
170
|
+
*/
|
|
171
|
+
const ADMISSION_ENRICHMENT_SLOT_COUNT = 5;
|
|
172
|
+
function countLoadedEnrichmentSlots(input, options) {
|
|
173
|
+
let loaded = 0;
|
|
174
|
+
if (input.designSystemContext)
|
|
175
|
+
loaded++;
|
|
176
|
+
if (input.autonomyContext)
|
|
177
|
+
loaded++;
|
|
178
|
+
if (input.codeAreaQuality)
|
|
179
|
+
loaded++;
|
|
180
|
+
if (input.designAuthoritySignal)
|
|
181
|
+
loaded++;
|
|
182
|
+
if (options?.soulAlignmentOverride !== undefined)
|
|
183
|
+
loaded++;
|
|
184
|
+
return loaded;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Compute admission confidence in [0, 1] as a 50/50 blend of two
|
|
188
|
+
* independent evidence channels:
|
|
189
|
+
*
|
|
190
|
+
* 1. **Mapper coverage** — fraction of `ADMISSION_MAPPER_FIELDS`
|
|
191
|
+
* explicitly populated on the derived `PriorityInput`. Captures
|
|
192
|
+
* "how much issue/backlog signal did `mapIssueToPriorityInput`
|
|
193
|
+
* extract".
|
|
194
|
+
*
|
|
195
|
+
* 2. **Enrichment loaded** — fraction of RFC-0008 enrichment slots
|
|
196
|
+
* present on the input (or supplied via `options`). Captures "how
|
|
197
|
+
* much external context did the enrichment readers contribute".
|
|
198
|
+
*
|
|
199
|
+
* Bug fixed (AISDLC-172 / RFC-0009 §13 OQ-9): previously
|
|
200
|
+
* `computeConfidence(priorityInput)` from `priority.ts` was used, which
|
|
201
|
+
* counts against the full 16-field `SCORABLE_FIELDS` list and ignores
|
|
202
|
+
* enrichment success entirely. The result was a hard ~0.5 ceiling on
|
|
203
|
+
* admit confidence even when DID + DSB + maintainers + soul-tracks all
|
|
204
|
+
* loaded — those four positive observations contributed exactly zero
|
|
205
|
+
* to the formula's denominator and zero to its numerator.
|
|
206
|
+
*/
|
|
207
|
+
export function computeAdmissionConfidence(input, priorityInput, options) {
|
|
208
|
+
let providedMapper = 0;
|
|
209
|
+
for (const field of ADMISSION_MAPPER_FIELDS) {
|
|
210
|
+
if (priorityInput[field] !== undefined)
|
|
211
|
+
providedMapper++;
|
|
212
|
+
}
|
|
213
|
+
const mapperFraction = providedMapper / ADMISSION_MAPPER_FIELDS.length;
|
|
214
|
+
const loadedEnrichment = countLoadedEnrichmentSlots(input, options);
|
|
215
|
+
const enrichmentFraction = loadedEnrichment / ADMISSION_ENRICHMENT_SLOT_COUNT;
|
|
216
|
+
return 0.5 * mapperFraction + 0.5 * enrichmentFraction;
|
|
217
|
+
}
|
|
218
|
+
function clamp01(value) {
|
|
219
|
+
return Math.min(1, Math.max(0, value));
|
|
220
|
+
}
|
|
221
|
+
function clampCalibration(value) {
|
|
222
|
+
if (value === undefined)
|
|
223
|
+
return 1.0;
|
|
224
|
+
return Math.min(1.3, Math.max(0.7, value));
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Apply non-GitHub tracker overrides on top of the GitHub-shaped
|
|
228
|
+
* `mapIssueToPriorityInput` output. A field's override wins iff it is
|
|
229
|
+
* not `undefined`; this preserves the GitHub mapper's defaults for
|
|
230
|
+
* any field the override does not specify.
|
|
231
|
+
*/
|
|
232
|
+
function mergePriorityInputOverrides(base, overrides) {
|
|
233
|
+
const merged = { ...base };
|
|
234
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
235
|
+
if (value !== undefined) {
|
|
236
|
+
merged[key] = value;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return merged;
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=admission-composite.js.map
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bridge between stateless admission scoring and the stateful orchestrator
|
|
3
|
+
* (RFC-0008 Addendum A §A.2 – §A.5).
|
|
4
|
+
*
|
|
5
|
+
* `enrichAdmissionInput()` reads from the orchestrator's state store and
|
|
6
|
+
* resolved resources to populate the RFC-0008 context fields on
|
|
7
|
+
* `AdmissionInput`, then `computeDesignSystemReadiness()` produces the
|
|
8
|
+
* Eρ₄ scalar that feeds the admission composite in §A.6.
|
|
9
|
+
*
|
|
10
|
+
* Scope for AISDLC-43: implement C2 (Eρ₄) only. C3/C4/C5 are populated
|
|
11
|
+
* by later tasks (AISDLC-44/45/46).
|
|
12
|
+
*/
|
|
13
|
+
import type { AutonomyPolicy, DesignIntentDocument, DesignSystemBinding } from '@ai-sdlc/reference';
|
|
14
|
+
import type { StateStore } from './state/store.js';
|
|
15
|
+
import type { AdmissionInput, AutonomyContext, CodeAreaQuality, DesignAuthoritySignal, DesignSystemContext } from './admission-score.js';
|
|
16
|
+
/**
|
|
17
|
+
* Minimum data points required before `code_area_metrics` is trusted
|
|
18
|
+
* enough to drive defect-risk penalties (RFC-0008 §7.4 Open Question 4).
|
|
19
|
+
*/
|
|
20
|
+
export declare const CODE_AREA_METRICS_MIN_DATA_POINTS = 10;
|
|
21
|
+
export type LifecyclePhase = 'preDesignSystem' | 'catalogBootstrap' | 'postDesignSystem';
|
|
22
|
+
export interface EnrichmentContext {
|
|
23
|
+
/** State store for reading visual baselines and code-area metrics. */
|
|
24
|
+
stateStore?: StateStore;
|
|
25
|
+
/** Resolved DesignSystemBinding referenced by the DID (absent ⇒ preDesignSystem). */
|
|
26
|
+
designSystemBinding?: DesignSystemBinding;
|
|
27
|
+
/** Resolved DesignIntentDocument. Unused in C2 but threaded through for future connections. */
|
|
28
|
+
designIntentDocument?: DesignIntentDocument;
|
|
29
|
+
/** ISO timestamp when the DSB was adopted — used for age-based lifecycle detection. */
|
|
30
|
+
dsbAdoptedAt?: string;
|
|
31
|
+
/** Catalog gaps supplied by a catalog-provider adapter (AISDLC-43 accepts these pre-computed). */
|
|
32
|
+
catalogGaps?: string[];
|
|
33
|
+
/** Code area for the issue (e.g. "orchestrator/src/priority"), used by C3. */
|
|
34
|
+
codeArea?: string;
|
|
35
|
+
/** Resolved AutonomyPolicy — used by C4. */
|
|
36
|
+
autonomyPolicy?: AutonomyPolicy;
|
|
37
|
+
/**
|
|
38
|
+
* Agent expected to handle the issue. Used to pick a specific entry
|
|
39
|
+
* from `autonomyPolicy.status.agents`. When absent, the most
|
|
40
|
+
* permissive currently-earned level across all agents is used.
|
|
41
|
+
*/
|
|
42
|
+
agentName?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Task complexity in [0, 10] for mapping to a required autonomy level.
|
|
45
|
+
* When omitted, C4 falls back to the most permissive level for the
|
|
46
|
+
* resolved agent (requiredLevel = currentEarnedLevel → gap = 0).
|
|
47
|
+
*/
|
|
48
|
+
complexity?: number;
|
|
49
|
+
/**
|
|
50
|
+
* Compliance score for the issue's area in [0, 1]. When present,
|
|
51
|
+
* `designAuthorityWeight` is modulated by `(1.2 - areaComplianceScore)`.
|
|
52
|
+
* When absent, the base weight applies unmodulated.
|
|
53
|
+
*/
|
|
54
|
+
areaComplianceScore?: number;
|
|
55
|
+
/** Clock injection for deterministic tests. Defaults to `Date.now`. */
|
|
56
|
+
now?: () => number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Populate `designSystemContext` on the admission input using the
|
|
60
|
+
* resolved DSB and state store. Returns the input unchanged when no DSB
|
|
61
|
+
* is available (preDesignSystem phase — caller falls through to the
|
|
62
|
+
* stateless path).
|
|
63
|
+
*/
|
|
64
|
+
export declare function enrichAdmissionInput(input: AdmissionInput, ctx: EnrichmentContext): AdmissionInput;
|
|
65
|
+
/**
|
|
66
|
+
* Compute the C3 defect-risk factor per §A.5. Returns 0 when
|
|
67
|
+
* `codeAreaQuality` is absent (insufficient data → no penalty).
|
|
68
|
+
*
|
|
69
|
+
* !hasFrontendComponents → 0.5×dd + 0.3×churn + 0.2×prRej
|
|
70
|
+
* hasFrontendComponents
|
|
71
|
+
* no designQuality → same as pure code (no blend target)
|
|
72
|
+
* with designQuality → 0.7 × code + 0.3 × design
|
|
73
|
+
* where design = 0.4×(1-ciPass)
|
|
74
|
+
* + 0.4×reviewRej
|
|
75
|
+
* + 0.2×(1-usabPass)
|
|
76
|
+
*
|
|
77
|
+
* Final value is clamped to [0, 0.5].
|
|
78
|
+
*/
|
|
79
|
+
export declare function computeDefectRiskFactor(quality: CodeAreaQuality | undefined): number;
|
|
80
|
+
/**
|
|
81
|
+
* Map task complexity to the required autonomy level per §A.4:
|
|
82
|
+
* complexity ≤ 3 → level 1
|
|
83
|
+
* complexity ≤ 6 → level 2
|
|
84
|
+
* else → level 3
|
|
85
|
+
*/
|
|
86
|
+
export declare function complexityToAutonomyLevel(complexity: number): number;
|
|
87
|
+
/**
|
|
88
|
+
* Compute the C4 autonomy factor per §A.5:
|
|
89
|
+
* gap = requiredLevel - currentEarnedLevel
|
|
90
|
+
* gap > 0 → max(0.1, 1.0 - gap × 0.4)
|
|
91
|
+
* gap ≤ 0 → 1.0
|
|
92
|
+
*/
|
|
93
|
+
export declare function computeAutonomyFactor(ctx: AutonomyContext | undefined): number;
|
|
94
|
+
/**
|
|
95
|
+
* Compute the C5 design-authority weight per §A.5.
|
|
96
|
+
*
|
|
97
|
+
* non-authority → 0.0
|
|
98
|
+
* authority + positive → +0.6 × modulation
|
|
99
|
+
* authority + negative → -0.4 × modulation
|
|
100
|
+
* authority + no type → +0.3 × modulation
|
|
101
|
+
*
|
|
102
|
+
* where `modulation = 1.2 - areaComplianceScore` when the score is
|
|
103
|
+
* supplied, else `1.0` (unmodulated base weight).
|
|
104
|
+
*/
|
|
105
|
+
export declare function computeDesignAuthorityWeight(signal: DesignAuthoritySignal | undefined): number;
|
|
106
|
+
/**
|
|
107
|
+
* Compute the C2 Eρ₄ design-system readiness scalar in [0, 1] per §A.5.
|
|
108
|
+
*
|
|
109
|
+
* preDesignSystem: 1.0 (no DSB → no penalty)
|
|
110
|
+
* catalogBootstrap: max(0.3, 0.4×cat + 0.3×tok + 0.3×baseline)
|
|
111
|
+
* postDesignSystem: 0.4×cat + 0.3×tok + 0.3×baseline
|
|
112
|
+
*/
|
|
113
|
+
export declare function computeDesignSystemReadiness(ctx: EnrichmentContext): number;
|
|
114
|
+
/**
|
|
115
|
+
* Compute the C2 Eρ₄ scalar directly from the DesignSystemContext
|
|
116
|
+
* already populated on an `AdmissionInput` (no DSB/state lookups).
|
|
117
|
+
*
|
|
118
|
+
* undefined (preDesignSystem) → 1.0
|
|
119
|
+
* inBootstrapPhase → max(0.3, computed)
|
|
120
|
+
* else → computed
|
|
121
|
+
*
|
|
122
|
+
* Used by the admission composite (§A.6) to avoid re-reading the state
|
|
123
|
+
* store on every score call.
|
|
124
|
+
*/
|
|
125
|
+
export declare function computeReadinessFromDesignSystemContext(context: DesignSystemContext | undefined): number;
|
|
126
|
+
export declare function detectLifecyclePhase(binding: DesignSystemBinding | undefined, normalizedCatalogCoverage: number, ageDays: number): LifecyclePhase;
|
|
127
|
+
/**
|
|
128
|
+
* Days since the DSB was adopted. Returns 0 when no adoption timestamp
|
|
129
|
+
* is supplied — the conservative default (treats DSB as brand-new and
|
|
130
|
+
* favours the bootstrap floor).
|
|
131
|
+
*/
|
|
132
|
+
export declare function computeDsbAgeDays(adoptedAt: string | undefined, now?: () => number): number;
|
|
133
|
+
/**
|
|
134
|
+
* Fraction of the UI under visual-regression monitoring for this binding,
|
|
135
|
+
* derived from approved baselines in `visual_regression_results`.
|
|
136
|
+
*
|
|
137
|
+
* Definition (§A.5 proxy): `approvedBaselines / totalBaselines`. Returns
|
|
138
|
+
* 0 when no history exists (bootstrap protection: avoids over-crediting
|
|
139
|
+
* readiness when the monitor hasn't run yet).
|
|
140
|
+
*/
|
|
141
|
+
export declare function computeBaselineCoverage(store: StateStore, bindingName: string): number;
|
|
142
|
+
//# sourceMappingURL=admission-enrichment.d.ts.map
|