@rasensio/aidlc 0.1.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/README.md +251 -0
- package/capabilities/claude-code.yaml +9 -0
- package/capabilities/codex.yaml +8 -0
- package/capabilities/cursor.yaml +8 -0
- package/capabilities/kiro.yaml +9 -0
- package/capabilities/windsurf.yaml +8 -0
- package/ci/aidlc-gate.yml +100 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +39 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add-action.d.ts +83 -0
- package/dist/commands/add-action.d.ts.map +1 -0
- package/dist/commands/add-action.js +437 -0
- package/dist/commands/add-action.js.map +1 -0
- package/dist/commands/continue.d.ts +23 -0
- package/dist/commands/continue.d.ts.map +1 -0
- package/dist/commands/continue.js +238 -0
- package/dist/commands/continue.js.map +1 -0
- package/dist/commands/discover.d.ts +19 -0
- package/dist/commands/discover.d.ts.map +1 -0
- package/dist/commands/discover.js +85 -0
- package/dist/commands/discover.js.map +1 -0
- package/dist/commands/docs.d.ts +25 -0
- package/dist/commands/docs.d.ts.map +1 -0
- package/dist/commands/docs.js +282 -0
- package/dist/commands/docs.js.map +1 -0
- package/dist/commands/gate.d.ts +25 -0
- package/dist/commands/gate.d.ts.map +1 -0
- package/dist/commands/gate.js +168 -0
- package/dist/commands/gate.js.map +1 -0
- package/dist/commands/init.d.ts +24 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +187 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/review.d.ts +60 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +264 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/setup.d.ts +24 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +206 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/start.d.ts +27 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +243 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +25 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +263 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/transition.d.ts +30 -0
- package/dist/commands/transition.d.ts.map +1 -0
- package/dist/commands/transition.js +353 -0
- package/dist/commands/transition.js.map +1 -0
- package/dist/compile/adapters/claude-code.d.ts +24 -0
- package/dist/compile/adapters/claude-code.d.ts.map +1 -0
- package/dist/compile/adapters/claude-code.js +271 -0
- package/dist/compile/adapters/claude-code.js.map +1 -0
- package/dist/compile/adapters/codex.d.ts +19 -0
- package/dist/compile/adapters/codex.d.ts.map +1 -0
- package/dist/compile/adapters/codex.js +157 -0
- package/dist/compile/adapters/codex.js.map +1 -0
- package/dist/compile/adapters/cursor.d.ts +21 -0
- package/dist/compile/adapters/cursor.d.ts.map +1 -0
- package/dist/compile/adapters/cursor.js +181 -0
- package/dist/compile/adapters/cursor.js.map +1 -0
- package/dist/compile/adapters/index.d.ts +16 -0
- package/dist/compile/adapters/index.d.ts.map +1 -0
- package/dist/compile/adapters/index.js +26 -0
- package/dist/compile/adapters/index.js.map +1 -0
- package/dist/compile/adapters/kiro.d.ts +24 -0
- package/dist/compile/adapters/kiro.d.ts.map +1 -0
- package/dist/compile/adapters/kiro.js +222 -0
- package/dist/compile/adapters/kiro.js.map +1 -0
- package/dist/compile/adapters/windsurf.d.ts +25 -0
- package/dist/compile/adapters/windsurf.d.ts.map +1 -0
- package/dist/compile/adapters/windsurf.js +242 -0
- package/dist/compile/adapters/windsurf.js.map +1 -0
- package/dist/compile/install-plan.d.ts +49 -0
- package/dist/compile/install-plan.d.ts.map +1 -0
- package/dist/compile/install-plan.js +112 -0
- package/dist/compile/install-plan.js.map +1 -0
- package/dist/compile/loaders.d.ts +81 -0
- package/dist/compile/loaders.d.ts.map +1 -0
- package/dist/compile/loaders.js +293 -0
- package/dist/compile/loaders.js.map +1 -0
- package/dist/compile/merger.d.ts +32 -0
- package/dist/compile/merger.d.ts.map +1 -0
- package/dist/compile/merger.js +60 -0
- package/dist/compile/merger.js.map +1 -0
- package/dist/core/gate.d.ts +36 -0
- package/dist/core/gate.d.ts.map +1 -0
- package/dist/core/gate.js +97 -0
- package/dist/core/gate.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +7 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lifecycle.d.ts +89 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +356 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/template-resolver.d.ts +56 -0
- package/dist/core/template-resolver.d.ts.map +1 -0
- package/dist/core/template-resolver.js +261 -0
- package/dist/core/template-resolver.js.map +1 -0
- package/dist/core/types.d.ts +527 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +1 -0
- package/dist/discover/scanner.d.ts +58 -0
- package/dist/discover/scanner.d.ts.map +1 -0
- package/dist/discover/scanner.js +772 -0
- package/dist/discover/scanner.js.map +1 -0
- package/dist/events/event-bus.d.ts +53 -0
- package/dist/events/event-bus.d.ts.map +1 -0
- package/dist/events/event-bus.js +263 -0
- package/dist/events/event-bus.js.map +1 -0
- package/dist/events/plugin-hooks.d.ts +44 -0
- package/dist/events/plugin-hooks.d.ts.map +1 -0
- package/dist/events/plugin-hooks.js +225 -0
- package/dist/events/plugin-hooks.js.map +1 -0
- package/dist/orchestrator/budget-packer.d.ts +57 -0
- package/dist/orchestrator/budget-packer.d.ts.map +1 -0
- package/dist/orchestrator/budget-packer.js +70 -0
- package/dist/orchestrator/budget-packer.js.map +1 -0
- package/dist/orchestrator/config.d.ts +43 -0
- package/dist/orchestrator/config.d.ts.map +1 -0
- package/dist/orchestrator/config.js +109 -0
- package/dist/orchestrator/config.js.map +1 -0
- package/dist/orchestrator/endpoint-clients.d.ts +23 -0
- package/dist/orchestrator/endpoint-clients.d.ts.map +1 -0
- package/dist/orchestrator/endpoint-clients.js +129 -0
- package/dist/orchestrator/endpoint-clients.js.map +1 -0
- package/dist/orchestrator/orchestrator-loop.d.ts +93 -0
- package/dist/orchestrator/orchestrator-loop.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator-loop.js +185 -0
- package/dist/orchestrator/orchestrator-loop.js.map +1 -0
- package/dist/security/confirmation.d.ts +90 -0
- package/dist/security/confirmation.d.ts.map +1 -0
- package/dist/security/confirmation.js +140 -0
- package/dist/security/confirmation.js.map +1 -0
- package/dist/setup/setup-compute.d.ts +54 -0
- package/dist/setup/setup-compute.d.ts.map +1 -0
- package/dist/setup/setup-compute.js +66 -0
- package/dist/setup/setup-compute.js.map +1 -0
- package/dist/state/snapshot-store.d.ts +79 -0
- package/dist/state/snapshot-store.d.ts.map +1 -0
- package/dist/state/snapshot-store.js +164 -0
- package/dist/state/snapshot-store.js.map +1 -0
- package/dist/state/state-recovery.d.ts +87 -0
- package/dist/state/state-recovery.d.ts.map +1 -0
- package/dist/state/state-recovery.js +274 -0
- package/dist/state/state-recovery.js.map +1 -0
- package/dist/state/transition-log.d.ts +40 -0
- package/dist/state/transition-log.d.ts.map +1 -0
- package/dist/state/transition-log.js +83 -0
- package/dist/state/transition-log.js.map +1 -0
- package/dist/state/yaml-helpers.d.ts +53 -0
- package/dist/state/yaml-helpers.d.ts.map +1 -0
- package/dist/state/yaml-helpers.js +110 -0
- package/dist/state/yaml-helpers.js.map +1 -0
- package/examples/.gitkeep +0 -0
- package/guidance/accessibility.md +67 -0
- package/guidance/api-conventions.md +124 -0
- package/guidance/index.yaml +7 -0
- package/guidance/secure-defaults.md +71 -0
- package/package.json +52 -0
- package/phases/.gitkeep +0 -0
- package/skills/00-overview.md +74 -0
- package/skills/10-ideation.md +45 -0
- package/skills/20-requirements.md +54 -0
- package/skills/30-design.md +57 -0
- package/skills/40-implementation.md +64 -0
- package/skills/50-testing.md +60 -0
- package/skills/60-deployment.md +63 -0
- package/skills/70-maintenance.md +56 -0
- package/skills/80-review.md +85 -0
- package/skills/81-continue.md +57 -0
- package/skills/82-add-action.md +71 -0
- package/templates/.gitkeep +0 -0
- package/templates/bugfix.yaml +14 -0
- package/templates/full-feature.yaml +44 -0
- package/templates/micro-task.yaml +11 -0
- package/templates/quick-feature.yaml +20 -0
- package/templates/spike.yaml +15 -0
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core TypeScript types for the AIDLC Framework.
|
|
3
|
+
*
|
|
4
|
+
* These types define the data models shared across all modules:
|
|
5
|
+
* CLI, state store, lifecycle engine, adapters, orchestrator, and events.
|
|
6
|
+
*/
|
|
7
|
+
/** Lifecycle phases in execution order. */
|
|
8
|
+
export type PhaseName = 'ideation' | 'requirements' | 'design' | 'implementation' | 'testing' | 'deployment' | 'maintenance';
|
|
9
|
+
/** Supported AI coding platforms. */
|
|
10
|
+
export type PlatformId = 'claude-code' | 'kiro' | 'cursor' | 'windsurf' | 'codex';
|
|
11
|
+
/** Scale of a lifecycle instance — determines which phases apply. */
|
|
12
|
+
export type CycleScope = 'full' | 'standard' | 'micro';
|
|
13
|
+
/** Status of a lifecycle phase within an instance. */
|
|
14
|
+
export type PhaseStatus = 'pending' | 'in-progress' | 'complete' | 'skipped';
|
|
15
|
+
/** Status of a single artifact. */
|
|
16
|
+
export type ArtifactStatus = 'not-started' | 'in-progress' | 'complete';
|
|
17
|
+
/** Transition types recorded in the append-only log. */
|
|
18
|
+
export type TransitionType = 'normal' | 'skip' | 'upgrade';
|
|
19
|
+
/** Lifecycle events that fire actions and plugin hooks. */
|
|
20
|
+
export type LifecycleEvent = 'on-instance-start' | 'on-phase-enter' | 'on-phase-exit' | 'on-instance-complete' | 'on-artifact-created';
|
|
21
|
+
/** Review finding severity levels. */
|
|
22
|
+
export type FindingSeverity = 'critical' | 'major' | 'minor' | 'info';
|
|
23
|
+
/** Review finding resolution status. */
|
|
24
|
+
export type FindingStatus = 'open' | 'resolved' | 'accepted-risk' | 'rejected';
|
|
25
|
+
/** Orchestrator API format. */
|
|
26
|
+
export type ApiFormat = 'ollama' | 'openai';
|
|
27
|
+
/** YAML frontmatter metadata from a universal skill file. */
|
|
28
|
+
export interface SkillMeta {
|
|
29
|
+
/** Skill name — lowercase, hyphens allowed. Required. */
|
|
30
|
+
name: string;
|
|
31
|
+
/** Human-readable description; drives auto-invocation on platforms. Required. */
|
|
32
|
+
description: string;
|
|
33
|
+
/** Lifecycle phase this skill belongs to. Required. */
|
|
34
|
+
phase: PhaseName;
|
|
35
|
+
/** Activation trigger description. Optional. */
|
|
36
|
+
trigger?: string;
|
|
37
|
+
/** Priority 1-100, default 50. Optional. */
|
|
38
|
+
priority?: number;
|
|
39
|
+
/** Per-platform hints mapping to native capability names. Optional. */
|
|
40
|
+
native_mode_hint?: Partial<Record<PlatformId, string>>;
|
|
41
|
+
}
|
|
42
|
+
/** A parsed universal skill definition (frontmatter + markdown body). */
|
|
43
|
+
export interface Skill {
|
|
44
|
+
meta: SkillMeta;
|
|
45
|
+
/** Markdown body content (everything after the YAML frontmatter). */
|
|
46
|
+
body: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A single file operation produced by a platform adapter.
|
|
50
|
+
*
|
|
51
|
+
* - `create` / `replace`: write full file content.
|
|
52
|
+
* - `merge-block`: replace or append content between managed delimiters
|
|
53
|
+
* (`<!-- aidlc:begin <blockId> -->` / `<!-- aidlc:end <blockId> -->`),
|
|
54
|
+
* preserving everything outside the markers byte-for-byte.
|
|
55
|
+
*/
|
|
56
|
+
export type FileOp = {
|
|
57
|
+
kind: 'create' | 'replace';
|
|
58
|
+
path: string;
|
|
59
|
+
content: string;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'merge-block';
|
|
62
|
+
path: string;
|
|
63
|
+
blockId: string;
|
|
64
|
+
content: string;
|
|
65
|
+
};
|
|
66
|
+
/** Result of a plan() call — a pure description of what to write. */
|
|
67
|
+
export interface InstallPlan {
|
|
68
|
+
/** Ordered list of file operations to apply. */
|
|
69
|
+
ops: FileOp[];
|
|
70
|
+
/** Non-fatal warnings (e.g., missing capabilities, unresolved placeholders). */
|
|
71
|
+
warnings: string[];
|
|
72
|
+
}
|
|
73
|
+
/** Result of platform-specific content validation on a single FileOp. */
|
|
74
|
+
export interface ValidationResult {
|
|
75
|
+
valid: boolean;
|
|
76
|
+
errors: string[];
|
|
77
|
+
warnings: string[];
|
|
78
|
+
}
|
|
79
|
+
/** Project context passed to adapters for placeholder resolution and shim generation. */
|
|
80
|
+
export interface ProjectContext {
|
|
81
|
+
/** Absolute path to the project root. */
|
|
82
|
+
root: string;
|
|
83
|
+
/** Available context docs (name → relative path from .aidlc/context/). */
|
|
84
|
+
contextDocs: Record<string, string>;
|
|
85
|
+
/** Active guidance layers (name → relative path from .aidlc/guidance/). */
|
|
86
|
+
guidanceLayers: Record<string, string>;
|
|
87
|
+
}
|
|
88
|
+
/** Interface every platform adapter implements. */
|
|
89
|
+
export interface PlatformAdapter {
|
|
90
|
+
readonly id: PlatformId;
|
|
91
|
+
/** Produce an install plan from parsed skills, capability map, and project context. */
|
|
92
|
+
plan(skills: Skill[], caps: CapabilityMap | null, ctx: ProjectContext): InstallPlan;
|
|
93
|
+
/** Validate a single file operation against platform-specific rules. */
|
|
94
|
+
validate(op: FileOp): ValidationResult;
|
|
95
|
+
}
|
|
96
|
+
/** A single native platform capability entry. */
|
|
97
|
+
export interface CapabilityEntry {
|
|
98
|
+
/** Lifecycle phases this capability applies to. */
|
|
99
|
+
phases: PhaseName[];
|
|
100
|
+
/** Directive text to inject into the skill when this capability is active. */
|
|
101
|
+
activation: string;
|
|
102
|
+
}
|
|
103
|
+
/** Per-platform declaration of native features and their lifecycle phase mappings. */
|
|
104
|
+
export interface CapabilityMap {
|
|
105
|
+
/** Platform this map describes. */
|
|
106
|
+
platform: PlatformId;
|
|
107
|
+
/** Named capabilities with their phase coverage and activation text. */
|
|
108
|
+
capabilities: Record<string, CapabilityEntry>;
|
|
109
|
+
}
|
|
110
|
+
/** An artifact declaration within a template phase. */
|
|
111
|
+
export interface ArtifactDeclaration {
|
|
112
|
+
/** Artifact file name (e.g., "requirements.md"). */
|
|
113
|
+
name: string;
|
|
114
|
+
/** Expected file extension, inferred from name if omitted. */
|
|
115
|
+
extension?: string;
|
|
116
|
+
}
|
|
117
|
+
/** A phase entry within a workflow template. */
|
|
118
|
+
export interface TemplatePhase {
|
|
119
|
+
/** Phase name. */
|
|
120
|
+
name: PhaseName | string;
|
|
121
|
+
/** Artifacts that must be produced in this phase. */
|
|
122
|
+
required_artifacts: ArtifactDeclaration[];
|
|
123
|
+
/** Artifacts that may optionally be produced. */
|
|
124
|
+
optional_artifacts?: ArtifactDeclaration[];
|
|
125
|
+
}
|
|
126
|
+
/** Override block for template inheritance. */
|
|
127
|
+
export interface TemplatePhaseOverride {
|
|
128
|
+
/** Fields to override (merged at field level). */
|
|
129
|
+
required_artifacts?: ArtifactDeclaration[];
|
|
130
|
+
optional_artifacts?: ArtifactDeclaration[];
|
|
131
|
+
}
|
|
132
|
+
/** A phase to add via template inheritance. */
|
|
133
|
+
export interface TemplatePhaseAdd {
|
|
134
|
+
/** Phase definition. */
|
|
135
|
+
phase: TemplatePhase;
|
|
136
|
+
/** Insert before this phase. */
|
|
137
|
+
before?: PhaseName | string;
|
|
138
|
+
/** Insert after this phase. */
|
|
139
|
+
after?: PhaseName | string;
|
|
140
|
+
}
|
|
141
|
+
/** Workflow template defining lifecycle shape and gating. */
|
|
142
|
+
export interface WorkflowTemplate {
|
|
143
|
+
/** Template name (unique identifier). */
|
|
144
|
+
name: string;
|
|
145
|
+
/** Short human-readable description. */
|
|
146
|
+
description?: string;
|
|
147
|
+
/** Parent template name for inheritance; null if standalone. */
|
|
148
|
+
extends: string | null;
|
|
149
|
+
/** Default cycle scope for instances using this template. */
|
|
150
|
+
scope: CycleScope;
|
|
151
|
+
/** Ordered list of phases and their artifact requirements. */
|
|
152
|
+
phases: TemplatePhase[];
|
|
153
|
+
/** Phases to remove (inheritance only). */
|
|
154
|
+
remove?: (PhaseName | string)[];
|
|
155
|
+
/** Per-phase field overrides (inheritance only). */
|
|
156
|
+
override?: Record<string, TemplatePhaseOverride>;
|
|
157
|
+
/** Phases to add with positional insertion (inheritance only). */
|
|
158
|
+
add?: TemplatePhaseAdd[];
|
|
159
|
+
/** Phases that require a review gate (adversarial review). */
|
|
160
|
+
gates?: {
|
|
161
|
+
'adversarial-review'?: (PhaseName | string)[];
|
|
162
|
+
};
|
|
163
|
+
/** Extra gating rules beyond standard exit criteria. */
|
|
164
|
+
transition_rules?: TransitionRule[];
|
|
165
|
+
}
|
|
166
|
+
/** An extra transition rule beyond standard phase exit criteria. */
|
|
167
|
+
export interface TransitionRule {
|
|
168
|
+
/** Phase this rule applies to. */
|
|
169
|
+
phase: PhaseName | string;
|
|
170
|
+
/** Human-readable description of the additional gate. */
|
|
171
|
+
condition: string;
|
|
172
|
+
}
|
|
173
|
+
/** Instance claim — records which session owns the instance. */
|
|
174
|
+
export interface InstanceClaim {
|
|
175
|
+
/** Agent session identifier or user identity. */
|
|
176
|
+
session: string;
|
|
177
|
+
/** ISO 8601 UTC timestamp when the claim was first acquired. */
|
|
178
|
+
claimed_at: string;
|
|
179
|
+
/** ISO 8601 UTC timestamp of the last renewal. */
|
|
180
|
+
renewed_at: string;
|
|
181
|
+
}
|
|
182
|
+
/** Scope upgrade history entry. */
|
|
183
|
+
export interface ScopeUpgrade {
|
|
184
|
+
from: CycleScope;
|
|
185
|
+
to: CycleScope;
|
|
186
|
+
reason: string;
|
|
187
|
+
at: string;
|
|
188
|
+
by: string;
|
|
189
|
+
}
|
|
190
|
+
/** Full persisted state of a lifecycle instance (.aidlc/state/<name>/instance.yaml). */
|
|
191
|
+
export interface InstanceState {
|
|
192
|
+
/** Instance name (directory name, URL-safe). */
|
|
193
|
+
name: string;
|
|
194
|
+
/** Workflow template used. */
|
|
195
|
+
template: string;
|
|
196
|
+
/** Current cycle scope. */
|
|
197
|
+
scope: CycleScope;
|
|
198
|
+
/** ISO 8601 UTC creation timestamp. */
|
|
199
|
+
created_at: string;
|
|
200
|
+
/** Creator identity. */
|
|
201
|
+
created_by: string;
|
|
202
|
+
/** Current active phase. */
|
|
203
|
+
current_phase: PhaseName | string;
|
|
204
|
+
/** Active claim, or null if unclaimed. */
|
|
205
|
+
claim: InstanceClaim | null;
|
|
206
|
+
/** History of scope upgrades. */
|
|
207
|
+
scope_history: ScopeUpgrade[];
|
|
208
|
+
}
|
|
209
|
+
/** Compact summary returned by listInstances(). */
|
|
210
|
+
export interface InstanceSummary {
|
|
211
|
+
name: string;
|
|
212
|
+
template: string;
|
|
213
|
+
current_phase: PhaseName | string;
|
|
214
|
+
owner: string | null;
|
|
215
|
+
completion_percent: number;
|
|
216
|
+
last_updated: string;
|
|
217
|
+
stalled: boolean;
|
|
218
|
+
}
|
|
219
|
+
/** Initialization parameters for creating a new instance. */
|
|
220
|
+
export interface InstanceInit {
|
|
221
|
+
name: string;
|
|
222
|
+
template: string;
|
|
223
|
+
scope: CycleScope;
|
|
224
|
+
created_by: string;
|
|
225
|
+
}
|
|
226
|
+
/** Metadata subset of instance state for partial updates. */
|
|
227
|
+
export interface InstanceMeta {
|
|
228
|
+
current_phase?: PhaseName | string;
|
|
229
|
+
scope?: CycleScope;
|
|
230
|
+
claim?: InstanceClaim | null;
|
|
231
|
+
}
|
|
232
|
+
/** Per-phase metrics stored alongside phase state. */
|
|
233
|
+
export interface PhaseMetrics {
|
|
234
|
+
/** Elapsed time in seconds. */
|
|
235
|
+
elapsed_seconds: number;
|
|
236
|
+
/** Number of artifacts produced. */
|
|
237
|
+
artifact_count: number;
|
|
238
|
+
}
|
|
239
|
+
/** Artifact tracking entry within a phase state file. */
|
|
240
|
+
export interface ArtifactEntry {
|
|
241
|
+
name: string;
|
|
242
|
+
status: ArtifactStatus;
|
|
243
|
+
}
|
|
244
|
+
/** Persisted state of a single phase (.aidlc/state/<instance>/phase-<name>.yaml). */
|
|
245
|
+
export interface PhaseState {
|
|
246
|
+
/** Phase name. */
|
|
247
|
+
phase: PhaseName | string;
|
|
248
|
+
/** Current status. */
|
|
249
|
+
status: PhaseStatus;
|
|
250
|
+
/** Assigned owner (identity). */
|
|
251
|
+
owner: string | null;
|
|
252
|
+
/** ISO 8601 UTC timestamp when the phase was entered. */
|
|
253
|
+
entered_at: string | null;
|
|
254
|
+
/** ISO 8601 UTC timestamp when the phase was completed. */
|
|
255
|
+
completed_at: string | null;
|
|
256
|
+
/** Identity that completed the phase. */
|
|
257
|
+
completed_by: string | null;
|
|
258
|
+
/** Reason for skip (references the scope rule). Null unless status is 'skipped'. */
|
|
259
|
+
skip_reason: string | null;
|
|
260
|
+
/** Artifact tracking for this phase. */
|
|
261
|
+
artifacts: ArtifactEntry[];
|
|
262
|
+
/** Phase timing and count metrics. */
|
|
263
|
+
metrics: PhaseMetrics;
|
|
264
|
+
}
|
|
265
|
+
/** A single entry in the append-only transitions.log (NDJSON). */
|
|
266
|
+
export interface TransitionRecord {
|
|
267
|
+
/** ISO 8601 UTC timestamp of the transition. */
|
|
268
|
+
at: string;
|
|
269
|
+
/** Identity that triggered the transition. */
|
|
270
|
+
by: string;
|
|
271
|
+
/** Source phase (null for non-phase-transition events like scope upgrade). */
|
|
272
|
+
from: PhaseName | string | null;
|
|
273
|
+
/** Target phase (null for non-phase-transition events). */
|
|
274
|
+
to: PhaseName | string | null;
|
|
275
|
+
/** Type of transition. */
|
|
276
|
+
type: TransitionType;
|
|
277
|
+
/** Exit criteria that were satisfied (for normal transitions). */
|
|
278
|
+
criteria?: string[];
|
|
279
|
+
/** Additional detail (for upgrade transitions). */
|
|
280
|
+
detail?: Record<string, unknown>;
|
|
281
|
+
}
|
|
282
|
+
/** Result of a claim attempt. */
|
|
283
|
+
export type ClaimResult = {
|
|
284
|
+
ok: true;
|
|
285
|
+
} | {
|
|
286
|
+
ok: false;
|
|
287
|
+
holder: string;
|
|
288
|
+
claimed_at: string;
|
|
289
|
+
stale: boolean;
|
|
290
|
+
};
|
|
291
|
+
/** The State Store interface — all state persistence flows through this. */
|
|
292
|
+
export interface StateStore {
|
|
293
|
+
/** List all lifecycle instances, optionally across branches. */
|
|
294
|
+
listInstances(opts?: {
|
|
295
|
+
allBranches?: boolean;
|
|
296
|
+
}): InstanceSummary[];
|
|
297
|
+
/** Load and validate a single instance's state. */
|
|
298
|
+
loadInstance(name: string): InstanceState;
|
|
299
|
+
/** Create a new lifecycle instance directory and initial state. */
|
|
300
|
+
createInstance(init: InstanceInit): InstanceState;
|
|
301
|
+
/** Atomically save a phase state file. */
|
|
302
|
+
savePhase(instance: string, phase: PhaseState): void;
|
|
303
|
+
/** Atomically update instance metadata. */
|
|
304
|
+
saveInstanceMeta(instance: string, meta: InstanceMeta): void;
|
|
305
|
+
/** Append a transition record to the instance's log. */
|
|
306
|
+
appendTransition(instance: string, rec: TransitionRecord): void;
|
|
307
|
+
/** Attempt to claim an instance for a session. */
|
|
308
|
+
claim(instance: string, session: string): ClaimResult;
|
|
309
|
+
/** Release a claim on an instance. */
|
|
310
|
+
releaseClaim(instance: string, session: string): void;
|
|
311
|
+
}
|
|
312
|
+
/** Result of gate evaluation: transition allowed. */
|
|
313
|
+
export interface TransitionAllowed {
|
|
314
|
+
allowed: true;
|
|
315
|
+
}
|
|
316
|
+
/** A single unsatisfied gate condition. */
|
|
317
|
+
export interface GateViolation {
|
|
318
|
+
/** Which gate failed. */
|
|
319
|
+
gate: 'exit-criteria' | 'required-artifacts' | 'review-gate' | 'ownership' | 'deployment-entry' | 'blocking-action';
|
|
320
|
+
/** Human-readable description of what is unsatisfied. */
|
|
321
|
+
reason: string;
|
|
322
|
+
}
|
|
323
|
+
/** Result of gate evaluation: transition blocked (lists all violations). */
|
|
324
|
+
export interface TransitionBlocked {
|
|
325
|
+
allowed: false;
|
|
326
|
+
violations: GateViolation[];
|
|
327
|
+
}
|
|
328
|
+
/** Union result of evaluateTransition(). */
|
|
329
|
+
export type TransitionResult = TransitionAllowed | TransitionBlocked;
|
|
330
|
+
/** Continuation resolver result: what the instance should do next. */
|
|
331
|
+
export type NextStep = {
|
|
332
|
+
kind: 'artifact';
|
|
333
|
+
phase: PhaseName | string;
|
|
334
|
+
artifact: string;
|
|
335
|
+
} | {
|
|
336
|
+
kind: 'phase';
|
|
337
|
+
phase: PhaseName | string;
|
|
338
|
+
} | {
|
|
339
|
+
kind: 'complete';
|
|
340
|
+
};
|
|
341
|
+
/** Validation result for micro-cycle initialization. */
|
|
342
|
+
export type MicroInitValidation = {
|
|
343
|
+
valid: true;
|
|
344
|
+
} | {
|
|
345
|
+
valid: false;
|
|
346
|
+
errors: string[];
|
|
347
|
+
};
|
|
348
|
+
/** Findings index used by the review gate. */
|
|
349
|
+
export interface FindingsIndex {
|
|
350
|
+
/** Per-artifact findings keyed by artifact name. */
|
|
351
|
+
[artifact: string]: Finding[];
|
|
352
|
+
}
|
|
353
|
+
/** A single review finding. */
|
|
354
|
+
export interface Finding {
|
|
355
|
+
id: string;
|
|
356
|
+
title: string;
|
|
357
|
+
severity: FindingSeverity;
|
|
358
|
+
status: FindingStatus;
|
|
359
|
+
section?: string;
|
|
360
|
+
issue?: string;
|
|
361
|
+
suggested_resolution?: string;
|
|
362
|
+
resolution_note?: string;
|
|
363
|
+
}
|
|
364
|
+
/** A single guidance layer entry in the index. */
|
|
365
|
+
export interface GuidanceIndexEntry {
|
|
366
|
+
/** Layer name (unique within the project). */
|
|
367
|
+
name: string;
|
|
368
|
+
/** Relative path to the markdown file from .aidlc/guidance/. */
|
|
369
|
+
file: string;
|
|
370
|
+
}
|
|
371
|
+
/** The .aidlc/guidance/index.yaml structure. */
|
|
372
|
+
export interface GuidanceIndex {
|
|
373
|
+
layers: GuidanceIndexEntry[];
|
|
374
|
+
}
|
|
375
|
+
/** Parsed guidance layer (frontmatter + body). */
|
|
376
|
+
export interface GuidanceLayer {
|
|
377
|
+
/** Layer name. */
|
|
378
|
+
name: string;
|
|
379
|
+
/** Human-readable description. */
|
|
380
|
+
description: string;
|
|
381
|
+
/** Markdown body content. */
|
|
382
|
+
body: string;
|
|
383
|
+
}
|
|
384
|
+
/** A built-in action reference (uses a known action by name). */
|
|
385
|
+
export interface BuiltInActionRef {
|
|
386
|
+
/** Built-in action identifier (e.g., "git-branch", "github-issue", "doc-update"). */
|
|
387
|
+
use: string;
|
|
388
|
+
/** Configuration parameters passed to the built-in. */
|
|
389
|
+
with?: Record<string, unknown>;
|
|
390
|
+
run?: never;
|
|
391
|
+
}
|
|
392
|
+
/** A custom action that runs a shell command. */
|
|
393
|
+
export interface CustomActionRef {
|
|
394
|
+
/** Shell command to execute. */
|
|
395
|
+
run: string;
|
|
396
|
+
use?: never;
|
|
397
|
+
with?: never;
|
|
398
|
+
}
|
|
399
|
+
/** A single action entry in actions.yaml. */
|
|
400
|
+
export interface ActionEntry {
|
|
401
|
+
/** Unique action identifier. */
|
|
402
|
+
id: string;
|
|
403
|
+
/** Lifecycle event that triggers this action. */
|
|
404
|
+
event: LifecycleEvent;
|
|
405
|
+
/** Optional phase filter — only fire when this phase is involved. */
|
|
406
|
+
phase?: PhaseName | string;
|
|
407
|
+
/** Whether this action is active. Only enabled actions ever execute. */
|
|
408
|
+
enabled: boolean;
|
|
409
|
+
/** Whether failure of this action should block the transition. */
|
|
410
|
+
blocking: boolean;
|
|
411
|
+
/** Human-readable description (preserved from AI-assisted authoring). */
|
|
412
|
+
description: string;
|
|
413
|
+
}
|
|
414
|
+
/** Complete action definition combining entry metadata with execution reference. */
|
|
415
|
+
export type ActionDefinition = ActionEntry & (BuiltInActionRef | CustomActionRef);
|
|
416
|
+
/** The .aidlc/actions.yaml file structure. */
|
|
417
|
+
export interface ActionsConfig {
|
|
418
|
+
version: number;
|
|
419
|
+
actions: ActionDefinition[];
|
|
420
|
+
}
|
|
421
|
+
/** Payload passed to action runners and plugin hooks. */
|
|
422
|
+
export interface EventPayload {
|
|
423
|
+
event: LifecycleEvent;
|
|
424
|
+
instance: string;
|
|
425
|
+
phase?: PhaseName | string;
|
|
426
|
+
template: string;
|
|
427
|
+
}
|
|
428
|
+
/** Report from the event dispatcher describing what fired. */
|
|
429
|
+
export interface DispatchReport {
|
|
430
|
+
/** Actions/hooks that were executed (or would be in dry-run). */
|
|
431
|
+
fired: Array<{
|
|
432
|
+
id: string;
|
|
433
|
+
success: boolean;
|
|
434
|
+
error?: string;
|
|
435
|
+
}>;
|
|
436
|
+
/** Whether the dispatch was a dry run (no side effects). */
|
|
437
|
+
dryRun: boolean;
|
|
438
|
+
}
|
|
439
|
+
/** A criterion description (entry or exit). */
|
|
440
|
+
export interface PhaseCriterion {
|
|
441
|
+
description: string;
|
|
442
|
+
}
|
|
443
|
+
/** Custom phase insertion point. */
|
|
444
|
+
export interface PhaseInsertionPoint {
|
|
445
|
+
before?: PhaseName | string;
|
|
446
|
+
after?: PhaseName | string;
|
|
447
|
+
}
|
|
448
|
+
/** A phase definition loaded from phases/*.yaml. */
|
|
449
|
+
export interface PhaseDefinition {
|
|
450
|
+
/** Phase name. */
|
|
451
|
+
name: PhaseName | string;
|
|
452
|
+
/** Human-readable purpose (1-3 sentences). */
|
|
453
|
+
description: string;
|
|
454
|
+
/** Conditions that must be true before entering this phase. */
|
|
455
|
+
entry_criteria: PhaseCriterion[];
|
|
456
|
+
/** Artifacts that must be produced. */
|
|
457
|
+
required_artifacts: ArtifactDeclaration[];
|
|
458
|
+
/** Artifacts that may optionally be produced. */
|
|
459
|
+
optional_artifacts: ArtifactDeclaration[];
|
|
460
|
+
/** Conditions that must be true before leaving this phase. */
|
|
461
|
+
exit_criteria: PhaseCriterion[];
|
|
462
|
+
/** Insertion point for custom phases (absent for core phases). */
|
|
463
|
+
insert?: PhaseInsertionPoint;
|
|
464
|
+
}
|
|
465
|
+
/** A hook declaration in a plugin manifest. */
|
|
466
|
+
export interface PluginHook {
|
|
467
|
+
/** Event that triggers this hook. */
|
|
468
|
+
event: LifecycleEvent;
|
|
469
|
+
/** Shell command or script path to execute. */
|
|
470
|
+
run: string;
|
|
471
|
+
}
|
|
472
|
+
/** Plugin manifest (.aidlc/plugins/<name>/plugin.yaml). */
|
|
473
|
+
export interface PluginManifest {
|
|
474
|
+
/** Plugin name. */
|
|
475
|
+
name: string;
|
|
476
|
+
/** Semver version string. */
|
|
477
|
+
version: string;
|
|
478
|
+
/** Human-readable description. */
|
|
479
|
+
description: string;
|
|
480
|
+
/** Relative paths to skill files provided by this plugin. */
|
|
481
|
+
skills: string[];
|
|
482
|
+
/** Hook declarations. */
|
|
483
|
+
hooks: PluginHook[];
|
|
484
|
+
}
|
|
485
|
+
/** A chat message for endpoint communication. */
|
|
486
|
+
export interface ChatMessage {
|
|
487
|
+
role: 'system' | 'user' | 'assistant';
|
|
488
|
+
content: string;
|
|
489
|
+
}
|
|
490
|
+
/** Options for a chat request. */
|
|
491
|
+
export interface ChatOpts {
|
|
492
|
+
model: string;
|
|
493
|
+
temperature?: number;
|
|
494
|
+
max_tokens?: number;
|
|
495
|
+
}
|
|
496
|
+
/** Response from an endpoint client. */
|
|
497
|
+
export interface ChatResponse {
|
|
498
|
+
content: string;
|
|
499
|
+
finish_reason?: string;
|
|
500
|
+
}
|
|
501
|
+
/** Endpoint client interface for orchestrator mode. */
|
|
502
|
+
export interface EndpointClient {
|
|
503
|
+
chat(messages: ChatMessage[], opts: ChatOpts): Promise<ChatResponse>;
|
|
504
|
+
}
|
|
505
|
+
/** Orchestrator-specific configuration. */
|
|
506
|
+
export interface OrchestratorConfig {
|
|
507
|
+
endpoint: string;
|
|
508
|
+
model: string;
|
|
509
|
+
api_format: ApiFormat;
|
|
510
|
+
review_model: string | null;
|
|
511
|
+
auto_advance: boolean;
|
|
512
|
+
context_budget_tokens: number;
|
|
513
|
+
}
|
|
514
|
+
/** Top-level project configuration (.aidlc/config.yaml). */
|
|
515
|
+
export interface ProjectConfig {
|
|
516
|
+
version: number;
|
|
517
|
+
defaults: {
|
|
518
|
+
scope: CycleScope;
|
|
519
|
+
template: string;
|
|
520
|
+
};
|
|
521
|
+
stalled_threshold_days: number;
|
|
522
|
+
claim_timeout_minutes: number;
|
|
523
|
+
summary_threshold_bytes: number;
|
|
524
|
+
orchestrator?: OrchestratorConfig;
|
|
525
|
+
secret_patterns?: string[];
|
|
526
|
+
}
|
|
527
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,2CAA2C;AAC3C,MAAM,MAAM,SAAS,GACjB,UAAU,GACV,cAAc,GACd,QAAQ,GACR,gBAAgB,GAChB,SAAS,GACT,YAAY,GACZ,aAAa,CAAC;AAElB,qCAAqC;AACrC,MAAM,MAAM,UAAU,GAClB,aAAa,GACb,MAAM,GACN,QAAQ,GACR,UAAU,GACV,OAAO,CAAC;AAEZ,qEAAqE;AACrE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;AAEvD,sDAAsD;AACtD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7E,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,CAAC;AAExE,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE3D,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GACtB,mBAAmB,GACnB,gBAAgB,GAChB,eAAe,GACf,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B,sCAAsC;AACtC,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE,wCAAwC;AACxC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,eAAe,GAAG,UAAU,CAAC;AAE/E,+BAA+B;AAC/B,MAAM,MAAM,SAAS,GAAG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C;IACF,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codebase scanner for the AIDLC Discovery Engine.
|
|
3
|
+
*
|
|
4
|
+
* Static analysis only — no build, no execution (Req 15.7).
|
|
5
|
+
* Detects languages, frameworks, conventions and architecture.
|
|
6
|
+
* Writes Context_Docs to `.aidlc/context/`.
|
|
7
|
+
*
|
|
8
|
+
* Requirements: 15.1, 15.2, 15.5
|
|
9
|
+
*/
|
|
10
|
+
export interface LanguageEntry {
|
|
11
|
+
name: string;
|
|
12
|
+
fileCount: number;
|
|
13
|
+
percentage: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ScanResult {
|
|
16
|
+
languages: LanguageEntry[];
|
|
17
|
+
frameworks: string[];
|
|
18
|
+
conventions: {
|
|
19
|
+
indentation: string;
|
|
20
|
+
naming: string;
|
|
21
|
+
importStyle: string;
|
|
22
|
+
};
|
|
23
|
+
architecture: {
|
|
24
|
+
structure: string;
|
|
25
|
+
entryPoints: string[];
|
|
26
|
+
configApproach: string;
|
|
27
|
+
};
|
|
28
|
+
filesScanned: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Scan a codebase and produce a structured scan result.
|
|
32
|
+
* Static analysis only — no build, no execution (Req 15.7).
|
|
33
|
+
*
|
|
34
|
+
* @param projectRoot - Absolute path to the project root.
|
|
35
|
+
* @returns Structured scan result with languages, frameworks, conventions, and architecture.
|
|
36
|
+
*/
|
|
37
|
+
export declare function scanCodebase(projectRoot: string): ScanResult;
|
|
38
|
+
/**
|
|
39
|
+
* Render a style-guide.md Context_Doc from scan results.
|
|
40
|
+
* Includes `generated_by: aidlc-discover` frontmatter.
|
|
41
|
+
*/
|
|
42
|
+
export declare function renderStyleGuide(result: ScanResult): string;
|
|
43
|
+
/**
|
|
44
|
+
* Render an architecture.md Context_Doc from scan results.
|
|
45
|
+
* Includes `generated_by: aidlc-discover` frontmatter.
|
|
46
|
+
*/
|
|
47
|
+
export declare function renderArchitectureDoc(result: ScanResult): string;
|
|
48
|
+
/**
|
|
49
|
+
* Write generated Context_Docs to `.aidlc/context/`.
|
|
50
|
+
* Creates the directory if it doesn't exist.
|
|
51
|
+
* Total output ≤ 100KB, ≤ 10 files (Req 15.5, 17.2).
|
|
52
|
+
*
|
|
53
|
+
* @param projectRoot - Absolute path to the project root.
|
|
54
|
+
* @param result - Scan result to render.
|
|
55
|
+
* @returns Paths of written files relative to projectRoot.
|
|
56
|
+
*/
|
|
57
|
+
export declare function writeContextDocs(projectRoot: string, result: ScanResult): string[];
|
|
58
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/discover/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,YAAY,EAAE;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,YAAY,EAAE,MAAM,CAAC;CACtB;AA6pBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,UAAU,CAe5D;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA2C3D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA6ChE;AAMD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,UAAU,GACjB,MAAM,EAAE,CAiBV"}
|