@devtrack-solution/codesdd 1.2.3 → 1.2.4
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/.sdd/skills/curated/devtrack-api/SKILL.md +98 -12
- package/.sdd/skills/curated/devtrack-api/agents/claude-code.yaml +10 -0
- package/.sdd/skills/curated/devtrack-api/agents/codex.yaml +10 -0
- package/.sdd/skills/curated/devtrack-api/agents/cursor.yaml +10 -0
- package/.sdd/skills/curated/devtrack-api/agents/gemini.yaml +10 -0
- package/.sdd/skills/curated/devtrack-api/agents/kimi.yaml +10 -0
- package/.sdd/skills/curated/devtrack-api/agents/openai.yaml +5 -3
- package/.sdd/skills/curated/devtrack-api/agents/opencode.yaml +12 -0
- package/.sdd/skills/curated/devtrack-api/references/application-presentation.md +61 -5
- package/.sdd/skills/curated/devtrack-api/references/consumer-sync-policy.md +15 -3
- package/.sdd/skills/curated/devtrack-api/references/contract-pack.yaml +1951 -0
- package/.sdd/skills/curated/devtrack-api/references/domain-modeling.md +16 -14
- package/.sdd/skills/curated/devtrack-api/references/field-validation-protocol.md +40 -0
- package/.sdd/skills/curated/devtrack-api/references/foundation-layout.md +19 -2
- package/.sdd/skills/curated/devtrack-api/references/generated-artifact-invalidation.md +97 -0
- package/.sdd/skills/curated/devtrack-api/references/implementation-checklist.md +30 -1
- package/.sdd/skills/curated/devtrack-api/references/portable-agent-contract.md +42 -0
- package/.sdd/skills/curated/devtrack-api/references/testing-validation.md +22 -1
- package/.sdd/skills/curated/devtrack-api/references/typeorm-infrastructure.md +9 -7
- package/README.md +280 -29
- package/dist/applications/sdd/index.d.ts +16 -0
- package/dist/applications/sdd/index.js +16 -0
- package/dist/cli/program.js +180 -11
- package/dist/commands/config.js +197 -10
- package/dist/commands/sdd/execution.js +408 -16
- package/dist/commands/sdd/plugin.js +5 -0
- package/dist/commands/sdd/shared.d.ts +1 -0
- package/dist/commands/sdd/shared.js +10 -0
- package/dist/commands/sdd.js +157 -7
- package/dist/core/cli/command-matrix.d.ts +18 -0
- package/dist/core/cli/command-matrix.js +157 -0
- package/dist/core/cli-command-quality.js +11 -0
- package/dist/core/completions/command-registry.js +45 -0
- package/dist/core/config-schema.d.ts +31 -1
- package/dist/core/config-schema.js +79 -5
- package/dist/core/config.d.ts +1 -0
- package/dist/core/config.js +11 -0
- package/dist/core/global-config.d.ts +29 -0
- package/dist/core/init.d.ts +2 -2
- package/dist/core/init.js +13 -14
- package/dist/core/sdd/agent-binding.d.ts +19 -19
- package/dist/core/sdd/agent-runtime-contract.d.ts +204 -0
- package/dist/core/sdd/agent-runtime-contract.js +200 -0
- package/dist/core/sdd/allocator-recovery.d.ts +14 -0
- package/dist/core/sdd/allocator-recovery.js +30 -0
- package/dist/core/sdd/allocator-security.d.ts +18 -0
- package/dist/core/sdd/allocator-security.js +36 -0
- package/dist/core/sdd/api-foundation-baseline.d.ts +111 -0
- package/dist/core/sdd/api-foundation-baseline.js +151 -0
- package/dist/core/sdd/api-foundation-parity.d.ts +114 -0
- package/dist/core/sdd/api-foundation-parity.js +131 -0
- package/dist/core/sdd/api-profile-catalog.d.ts +36 -0
- package/dist/core/sdd/api-profile-catalog.js +132 -0
- package/dist/core/sdd/api-profile-dry-run-projection.d.ts +93 -0
- package/dist/core/sdd/api-profile-dry-run-projection.js +370 -0
- package/dist/core/sdd/api-profile-recipes.d.ts +82 -0
- package/dist/core/sdd/api-profile-recipes.js +484 -0
- package/dist/core/sdd/artifact-id-allocator.d.ts +368 -0
- package/dist/core/sdd/artifact-id-allocator.js +510 -0
- package/dist/core/sdd/check.d.ts +52 -1
- package/dist/core/sdd/check.js +326 -11
- package/dist/core/sdd/coordination/coordination-adapters.d.ts +15 -8
- package/dist/core/sdd/coordination/coordination-adapters.js +43 -15
- package/dist/core/sdd/coordination/index.d.ts +1 -0
- package/dist/core/sdd/coordination/index.js +1 -0
- package/dist/core/sdd/coordination/redis-runtime.d.ts +131 -0
- package/dist/core/sdd/coordination/redis-runtime.js +698 -0
- package/dist/core/sdd/deepagent-contracts.d.ts +99 -5
- package/dist/core/sdd/deepagent-contracts.js +62 -0
- package/dist/core/sdd/deepagents/reversa-subagents.d.ts +3 -3
- package/dist/core/sdd/default-bootstrap-files.d.ts +2 -2
- package/dist/core/sdd/default-bootstrap-files.js +14 -10
- package/dist/core/sdd/default-skills.js +115 -9
- package/dist/core/sdd/devtrack-api-appliance.d.ts +42 -1
- package/dist/core/sdd/devtrack-api-appliance.js +159 -32
- package/dist/core/sdd/devtrack-api-architecture.d.ts +16 -0
- package/dist/core/sdd/devtrack-api-architecture.js +86 -0
- package/dist/core/sdd/docs-sync.js +24 -18
- package/dist/core/sdd/domain/capability-diff.d.ts +63 -0
- package/dist/core/sdd/domain/capability-diff.js +200 -0
- package/dist/core/sdd/domain/change-safety-guardrails.d.ts +74 -0
- package/dist/core/sdd/domain/change-safety-guardrails.js +333 -0
- package/dist/core/sdd/domain/semantic-intent-classifier.d.ts +29 -0
- package/dist/core/sdd/domain/semantic-intent-classifier.js +117 -0
- package/dist/core/sdd/enterprise-mutating-command-gate.d.ts +27 -0
- package/dist/core/sdd/enterprise-mutating-command-gate.js +104 -0
- package/dist/core/sdd/enterprise-provenance-gates.d.ts +20 -0
- package/dist/core/sdd/enterprise-provenance-gates.js +63 -0
- package/dist/core/sdd/enterprise-provisioning-policy.d.ts +26 -0
- package/dist/core/sdd/enterprise-provisioning-policy.js +104 -0
- package/dist/core/sdd/foundation-artifact-map-validator.d.ts +16 -0
- package/dist/core/sdd/foundation-artifact-map-validator.js +71 -0
- package/dist/core/sdd/foundation-layer-manifest.d.ts +24 -0
- package/dist/core/sdd/foundation-layer-manifest.js +117 -0
- package/dist/core/sdd/governance-schemas.d.ts +2 -2
- package/dist/core/sdd/governance-schemas.js +11 -2
- package/dist/core/sdd/intent-guard.d.ts +22 -0
- package/dist/core/sdd/intent-guard.js +67 -0
- package/dist/core/sdd/json-schema.js +13 -1
- package/dist/core/sdd/legacy-operations.js +169 -5
- package/dist/core/sdd/migrate-workspace.js +39 -0
- package/dist/core/sdd/package-security-gates.d.ts +21 -0
- package/dist/core/sdd/package-security-gates.js +121 -0
- package/dist/core/sdd/package-structure-gate.d.ts +85 -3
- package/dist/core/sdd/package-structure-gate.js +384 -11
- package/dist/core/sdd/parallel-feat-automation.d.ts +185 -7
- package/dist/core/sdd/parallel-feat-automation.js +212 -0
- package/dist/core/sdd/plugin-broker.d.ts +223 -4
- package/dist/core/sdd/plugin-broker.js +10 -0
- package/dist/core/sdd/plugin-cli.d.ts +30 -0
- package/dist/core/sdd/plugin-cli.js +70 -3
- package/dist/core/sdd/plugin-evidence.d.ts +73 -0
- package/dist/core/sdd/plugin-manifest.d.ts +69 -1
- package/dist/core/sdd/plugin-manifest.js +10 -0
- package/dist/core/sdd/plugin-policy-pack.d.ts +1 -1
- package/dist/core/sdd/plugin-policy.js +6 -1
- package/dist/core/sdd/plugin-registry.d.ts +138 -2
- package/dist/core/sdd/plugin-sdk-contract.d.ts +363 -0
- package/dist/core/sdd/plugin-sdk-contract.js +268 -0
- package/dist/core/sdd/plugin-skill-binding.d.ts +1 -1
- package/dist/core/sdd/quality-validation.d.ts +89 -16
- package/dist/core/sdd/release-readiness.d.ts +68 -0
- package/dist/core/sdd/release-readiness.js +767 -0
- package/dist/core/sdd/reversa-architecture-extractor.d.ts +13 -0
- package/dist/core/sdd/reversa-architecture-extractor.js +89 -0
- package/dist/core/sdd/reversa-artifact-writer.d.ts +18 -0
- package/dist/core/sdd/reversa-artifact-writer.js +40 -0
- package/dist/core/sdd/reversa-command-policy.d.ts +136 -0
- package/dist/core/sdd/reversa-command-policy.js +361 -0
- package/dist/core/sdd/reversa-data-extractor.d.ts +11 -0
- package/dist/core/sdd/reversa-data-extractor.js +73 -0
- package/dist/core/sdd/reversa-equivalence.d.ts +20 -0
- package/dist/core/sdd/reversa-equivalence.js +34 -0
- package/dist/core/sdd/reversa-evidence.d.ts +298 -0
- package/dist/core/sdd/reversa-evidence.js +118 -0
- package/dist/core/sdd/reversa-reconstruction.d.ts +29 -0
- package/dist/core/sdd/reversa-reconstruction.js +32 -0
- package/dist/core/sdd/reversa-rules-extractor.d.ts +12 -0
- package/dist/core/sdd/reversa-rules-extractor.js +86 -0
- package/dist/core/sdd/reversa-source-safety.d.ts +19 -0
- package/dist/core/sdd/reversa-source-safety.js +105 -0
- package/dist/core/sdd/reversa-surface-scout.d.ts +13 -0
- package/dist/core/sdd/reversa-surface-scout.js +85 -0
- package/dist/core/sdd/reversa-ux-mapper.d.ts +11 -0
- package/dist/core/sdd/reversa-ux-mapper.js +73 -0
- package/dist/core/sdd/runtime-boundary-contract.d.ts +45 -0
- package/dist/core/sdd/runtime-boundary-contract.js +90 -0
- package/dist/core/sdd/sdk-agent-plugin-quality-gates.d.ts +150 -0
- package/dist/core/sdd/sdk-agent-plugin-quality-gates.js +258 -0
- package/dist/core/sdd/services/agent-run.service.d.ts +38 -6
- package/dist/core/sdd/services/agent-run.service.js +73 -1
- package/dist/core/sdd/services/archive-quality-coherence.service.d.ts +17 -0
- package/dist/core/sdd/services/archive-quality-coherence.service.js +141 -0
- package/dist/core/sdd/services/capability-diff.service.d.ts +18 -0
- package/dist/core/sdd/services/capability-diff.service.js +26 -0
- package/dist/core/sdd/services/change-safety-preflight.service.d.ts +17 -0
- package/dist/core/sdd/services/change-safety-preflight.service.js +17 -0
- package/dist/core/sdd/services/context.service.d.ts +43 -340
- package/dist/core/sdd/services/context.service.js +323 -9
- package/dist/core/sdd/services/decide.service.js +1 -1
- package/dist/core/sdd/services/finalize.service.d.ts +27 -0
- package/dist/core/sdd/services/finalize.service.js +226 -18
- package/dist/core/sdd/services/frontend-impact.service.d.ts +1 -1
- package/dist/core/sdd/services/historical-quality-regression.service.d.ts +35 -0
- package/dist/core/sdd/services/historical-quality-regression.service.js +228 -0
- package/dist/core/sdd/services/ingest-deposito.service.js +1 -1
- package/dist/core/sdd/services/planning-execution-coherence.service.d.ts +45 -0
- package/dist/core/sdd/services/planning-execution-coherence.service.js +225 -0
- package/dist/core/sdd/services/semantic-intent-classifier.service.d.ts +6 -0
- package/dist/core/sdd/services/semantic-intent-classifier.service.js +7 -0
- package/dist/core/sdd/state.d.ts +1 -0
- package/dist/core/sdd/state.js +266 -34
- package/dist/core/sdd/store/sdd-stores.js +2 -2
- package/dist/core/sdd/structural-health.d.ts +13 -13
- package/dist/core/sdd/types.d.ts +30 -15
- package/dist/core/sdd/types.js +4 -0
- package/dist/core/sdd/views.js +17 -0
- package/dist/core/sdd/workspace-schemas.d.ts +428 -7
- package/dist/core/sdd/workspace-schemas.js +223 -70
- package/dist/core/shared/skill-generation.d.ts +2 -0
- package/dist/core/shared/skill-generation.js +19 -2
- package/dist/core/shared/tool-detection.d.ts +19 -0
- package/dist/core/shared/tool-detection.js +89 -0
- package/dist/domains/sdd/index.d.ts +6 -0
- package/dist/domains/sdd/index.js +6 -0
- package/dist/infrastructures/sdd/index.d.ts +7 -0
- package/dist/infrastructures/sdd/index.js +6 -0
- package/dist/presentations/cli/sdd/index.d.ts +3 -0
- package/dist/presentations/cli/sdd/index.js +3 -0
- package/dist/shared/sdd/index.d.ts +3 -0
- package/dist/shared/sdd/index.js +2 -0
- package/package.json +14 -10
- package/schemas/sdd/2-plan.schema.json +207 -2
- package/schemas/sdd/5-quality.schema.json +324 -25
- package/schemas/sdd/agent-runtime-command-plan.schema.json +212 -0
- package/schemas/sdd/agent-runtime-opencode-run-evidence.schema.json +270 -0
- package/schemas/sdd/codesdd-plugin.schema.json +171 -0
- package/schemas/sdd/deepagent-run-request.schema.json +316 -0
- package/schemas/sdd/parallel-feat-automation-plan.schema.json +89 -0
- package/schemas/sdd/parallel-feat-scheduler-request.schema.json +116 -0
- package/schemas/sdd/parallel-feat-scheduler-result.schema.json +404 -0
- package/schemas/sdd/plugin-artifact-manifest.schema.json +109 -0
- package/schemas/sdd/plugin-artifact-map.schema.json +223 -0
- package/schemas/sdd/plugin-evidence-manifest.schema.json +109 -0
- package/schemas/sdd/plugin-language-runtime.schema.json +103 -0
- package/schemas/sdd/plugin-package-governance.schema.json +74 -0
- package/schemas/sdd/plugin-registry.schema.json +171 -0
- package/schemas/sdd/plugin-runtime-invocation-plan.schema.json +109 -0
- package/schemas/sdd/quality-evidence-bundle.schema.json +109 -0
- package/schemas/sdd/reversa-evidence-bundle.schema.json +466 -0
- package/schemas/sdd/sdk-agent-plugin-quality-gate-input.schema.json +168 -0
- package/schemas/sdd/sdk-agent-plugin-quality-gate-report.schema.json +160 -0
- package/schemas/sdd/workspace-catalog.schema.json +5298 -1409
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { attestReversaSource } from './reversa-source-safety.js';
|
|
2
|
+
export function buildReversaDataLineage(input) {
|
|
3
|
+
const accepted = input.sources
|
|
4
|
+
.map((source) => ({ source, attestation: attestReversaSource({ sourcePath: source.path, content: source.content }) }))
|
|
5
|
+
.filter((entry) => entry.attestation.status === 'accepted' && entry.attestation.attestation);
|
|
6
|
+
const entities = accepted.flatMap(({ source, attestation }) => scanEntities(attestation.normalized_path, source.content));
|
|
7
|
+
const lineage = accepted.flatMap(({ source, attestation }) => scanLineage(attestation.normalized_path, source.content));
|
|
8
|
+
const findings = [];
|
|
9
|
+
if (entities.length > 0) {
|
|
10
|
+
findings.push({
|
|
11
|
+
id: 'REV-FIND-DATA-ENTITIES',
|
|
12
|
+
phase: 'data',
|
|
13
|
+
title: 'Data entities and tables',
|
|
14
|
+
summary: `Detected ${entities.length} entity/table/model candidates.`,
|
|
15
|
+
confidence: 'medium',
|
|
16
|
+
source_refs: [...new Set(entities.map((entry) => entry.source_ref))],
|
|
17
|
+
contradiction_refs: [],
|
|
18
|
+
promoted_refs: [],
|
|
19
|
+
metadata: { entities },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (lineage.length > 0) {
|
|
23
|
+
findings.push({
|
|
24
|
+
id: 'REV-FIND-DATA-LINEAGE',
|
|
25
|
+
phase: 'data',
|
|
26
|
+
title: 'Persistence and lineage operations',
|
|
27
|
+
summary: `Detected ${lineage.length} persistence operation candidates.`,
|
|
28
|
+
confidence: 'medium',
|
|
29
|
+
source_refs: [...new Set(lineage.map((entry) => entry.source_ref))],
|
|
30
|
+
contradiction_refs: [],
|
|
31
|
+
promoted_refs: [],
|
|
32
|
+
metadata: { lineage },
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
schema_version: 1,
|
|
37
|
+
contract: 'reversa-evidence-bundle/v1',
|
|
38
|
+
operation_id: input.operationId,
|
|
39
|
+
generated_at: input.generatedAt,
|
|
40
|
+
feature_ref: input.featureRef,
|
|
41
|
+
mode: 'read-only',
|
|
42
|
+
source_attestations: accepted.map((entry) => entry.attestation.attestation),
|
|
43
|
+
findings,
|
|
44
|
+
artifacts: [{
|
|
45
|
+
path: `.sdd/evidence/reversa/${input.featureRef}/data-lineage.yaml`,
|
|
46
|
+
artifact_type: 'data_model',
|
|
47
|
+
phase: 'data',
|
|
48
|
+
produced_by: 'codesdd reversa data extractor',
|
|
49
|
+
write_scope: 'read_only',
|
|
50
|
+
}],
|
|
51
|
+
validations: [{
|
|
52
|
+
id: 'REV-VAL-DATA-SAFETY',
|
|
53
|
+
phase: 'data',
|
|
54
|
+
command: 'buildReversaDataLineage',
|
|
55
|
+
status: accepted.length === input.sources.length ? 'passed' : 'blocked',
|
|
56
|
+
issue_codes: accepted.length === input.sources.length ? [] : ['UNSAFE_SOURCE_BLOCKED'],
|
|
57
|
+
}],
|
|
58
|
+
contradictions: [],
|
|
59
|
+
human_questions: [],
|
|
60
|
+
quality_refs: [`.sdd/active/${input.featureRef}/5-quality.yaml`],
|
|
61
|
+
residual_risks: [],
|
|
62
|
+
metadata: { entity_count: entities.length, lineage_count: lineage.length },
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function scanEntities(sourceRef, content) {
|
|
66
|
+
const tableMatches = [...content.matchAll(/\b(?:CREATE\s+TABLE|@Entity|model)\s+["']?([A-Za-z0-9_]+)/giu)];
|
|
67
|
+
return tableMatches.map((match) => ({ name: match[1] ?? 'unknown', source_ref: sourceRef }));
|
|
68
|
+
}
|
|
69
|
+
function scanLineage(sourceRef, content) {
|
|
70
|
+
const matches = [...content.matchAll(/\b(?:save|insert|update|delete|find|query|repository)\b/giu)];
|
|
71
|
+
return matches.map((match) => ({ operation: match[0].toLowerCase(), source_ref: sourceRef }));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=reversa-data-extractor.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReversaEvidenceBundle, ReversaEvidencePhase } from './reversa-evidence.js';
|
|
2
|
+
import type { ReversaReconstructionPlan } from './reversa-reconstruction.js';
|
|
3
|
+
export interface ReversaEquivalenceReport {
|
|
4
|
+
schema_version: 1;
|
|
5
|
+
contract: 'reversa-equivalence-report/v1';
|
|
6
|
+
feature_ref: string;
|
|
7
|
+
q95_score: number;
|
|
8
|
+
status: 'pass' | 'warn' | 'fail';
|
|
9
|
+
covered_phases: ReversaEvidencePhase[];
|
|
10
|
+
missing_phases: ReversaEvidencePhase[];
|
|
11
|
+
validation_failures: string[];
|
|
12
|
+
residual_risks: string[];
|
|
13
|
+
runtime_operations: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function buildReversaEquivalenceReport(input: {
|
|
16
|
+
featureRef: string;
|
|
17
|
+
bundles: ReversaEvidenceBundle[];
|
|
18
|
+
reconstruction?: ReversaReconstructionPlan;
|
|
19
|
+
}): ReversaEquivalenceReport;
|
|
20
|
+
//# sourceMappingURL=reversa-equivalence.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const REQUIRED_PHASES = ['surface', 'architecture', 'rules', 'data', 'ux'];
|
|
2
|
+
export function buildReversaEquivalenceReport(input) {
|
|
3
|
+
const coveredPhases = [...new Set(input.bundles.flatMap((bundle) => bundle.findings.map((finding) => finding.phase)))]
|
|
4
|
+
.filter((phase) => REQUIRED_PHASES.includes(phase));
|
|
5
|
+
const missingPhases = REQUIRED_PHASES.filter((phase) => !coveredPhases.includes(phase));
|
|
6
|
+
const validationFailures = input.bundles.flatMap((bundle) => bundle.validations
|
|
7
|
+
.filter((validation) => validation.status === 'failed' || validation.status === 'blocked')
|
|
8
|
+
.map((validation) => validation.id));
|
|
9
|
+
const residualRisks = input.bundles.flatMap((bundle) => bundle.residual_risks.map((risk) => risk.code));
|
|
10
|
+
const reconstructionPenalty = input.reconstruction && input.reconstruction.status !== 'ready' ? 15 : 0;
|
|
11
|
+
const phaseScore = Math.round((coveredPhases.length / REQUIRED_PHASES.length) * 70);
|
|
12
|
+
const validationScore = validationFailures.length === 0 ? 15 : 0;
|
|
13
|
+
const riskScore = residualRisks.length === 0 ? 15 : Math.max(0, 15 - residualRisks.length * 5);
|
|
14
|
+
const q95Score = Math.max(0, phaseScore + validationScore + riskScore - reconstructionPenalty);
|
|
15
|
+
return {
|
|
16
|
+
schema_version: 1,
|
|
17
|
+
contract: 'reversa-equivalence-report/v1',
|
|
18
|
+
feature_ref: input.featureRef,
|
|
19
|
+
q95_score: q95Score,
|
|
20
|
+
status: q95Score >= 95 ? 'pass' : q95Score >= 80 ? 'warn' : 'fail',
|
|
21
|
+
covered_phases: coveredPhases,
|
|
22
|
+
missing_phases: missingPhases,
|
|
23
|
+
validation_failures: validationFailures,
|
|
24
|
+
residual_risks: residualRisks,
|
|
25
|
+
runtime_operations: [
|
|
26
|
+
'validate evidence bundle schemas',
|
|
27
|
+
'compare required extraction phases',
|
|
28
|
+
'check validation failures',
|
|
29
|
+
'check residual risks',
|
|
30
|
+
'verify reconstruction readiness',
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=reversa-equivalence.js.map
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const reversaEvidencePhaseSchema: z.ZodEnum<{
|
|
3
|
+
architecture: "architecture";
|
|
4
|
+
surface: "surface";
|
|
5
|
+
rules: "rules";
|
|
6
|
+
data: "data";
|
|
7
|
+
migration: "migration";
|
|
8
|
+
equivalence: "equivalence";
|
|
9
|
+
intake: "intake";
|
|
10
|
+
ux: "ux";
|
|
11
|
+
artifact_generation: "artifact_generation";
|
|
12
|
+
reconstruction: "reconstruction";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const reversaConfidenceSchema: z.ZodEnum<{
|
|
15
|
+
unknown: "unknown";
|
|
16
|
+
low: "low";
|
|
17
|
+
medium: "medium";
|
|
18
|
+
high: "high";
|
|
19
|
+
}>;
|
|
20
|
+
export declare const reversaSourceAttestationSchema: z.ZodObject<{
|
|
21
|
+
source_ref: z.ZodString;
|
|
22
|
+
source_type: z.ZodEnum<{
|
|
23
|
+
config: "config";
|
|
24
|
+
repository: "repository";
|
|
25
|
+
document: "document";
|
|
26
|
+
runtime_log: "runtime_log";
|
|
27
|
+
database_schema: "database_schema";
|
|
28
|
+
manual_note: "manual_note";
|
|
29
|
+
}>;
|
|
30
|
+
trust_level: z.ZodEnum<{
|
|
31
|
+
trusted: "trusted";
|
|
32
|
+
untrusted: "untrusted";
|
|
33
|
+
hostile: "hostile";
|
|
34
|
+
}>;
|
|
35
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
36
|
+
redaction_status: z.ZodEnum<{
|
|
37
|
+
blocked: "blocked";
|
|
38
|
+
redacted: "redacted";
|
|
39
|
+
not_required: "not_required";
|
|
40
|
+
}>;
|
|
41
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const reversaEvidenceFindingSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
phase: z.ZodEnum<{
|
|
46
|
+
architecture: "architecture";
|
|
47
|
+
surface: "surface";
|
|
48
|
+
rules: "rules";
|
|
49
|
+
data: "data";
|
|
50
|
+
migration: "migration";
|
|
51
|
+
equivalence: "equivalence";
|
|
52
|
+
intake: "intake";
|
|
53
|
+
ux: "ux";
|
|
54
|
+
artifact_generation: "artifact_generation";
|
|
55
|
+
reconstruction: "reconstruction";
|
|
56
|
+
}>;
|
|
57
|
+
title: z.ZodString;
|
|
58
|
+
summary: z.ZodString;
|
|
59
|
+
confidence: z.ZodEnum<{
|
|
60
|
+
unknown: "unknown";
|
|
61
|
+
low: "low";
|
|
62
|
+
medium: "medium";
|
|
63
|
+
high: "high";
|
|
64
|
+
}>;
|
|
65
|
+
source_refs: z.ZodArray<z.ZodString>;
|
|
66
|
+
contradiction_refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
67
|
+
promoted_refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
68
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export declare const reversaEvidenceArtifactSchema: z.ZodObject<{
|
|
71
|
+
path: z.ZodString;
|
|
72
|
+
artifact_type: z.ZodEnum<{
|
|
73
|
+
inventory: "inventory";
|
|
74
|
+
architecture_map: "architecture_map";
|
|
75
|
+
business_rules: "business_rules";
|
|
76
|
+
data_model: "data_model";
|
|
77
|
+
ux_map: "ux_map";
|
|
78
|
+
generated_sdd_artifact: "generated_sdd_artifact";
|
|
79
|
+
migration_plan: "migration_plan";
|
|
80
|
+
reconstruction_diff: "reconstruction_diff";
|
|
81
|
+
equivalence_report: "equivalence_report";
|
|
82
|
+
question_set: "question_set";
|
|
83
|
+
}>;
|
|
84
|
+
phase: z.ZodEnum<{
|
|
85
|
+
architecture: "architecture";
|
|
86
|
+
surface: "surface";
|
|
87
|
+
rules: "rules";
|
|
88
|
+
data: "data";
|
|
89
|
+
migration: "migration";
|
|
90
|
+
equivalence: "equivalence";
|
|
91
|
+
intake: "intake";
|
|
92
|
+
ux: "ux";
|
|
93
|
+
artifact_generation: "artifact_generation";
|
|
94
|
+
reconstruction: "reconstruction";
|
|
95
|
+
}>;
|
|
96
|
+
checksum_sha256: z.ZodOptional<z.ZodString>;
|
|
97
|
+
produced_by: z.ZodString;
|
|
98
|
+
write_scope: z.ZodEnum<{
|
|
99
|
+
dry_run: "dry_run";
|
|
100
|
+
read_only: "read_only";
|
|
101
|
+
sandbox: "sandbox";
|
|
102
|
+
approved_apply: "approved_apply";
|
|
103
|
+
}>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
export declare const reversaEvidenceValidationSchema: z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
phase: z.ZodEnum<{
|
|
108
|
+
architecture: "architecture";
|
|
109
|
+
surface: "surface";
|
|
110
|
+
rules: "rules";
|
|
111
|
+
data: "data";
|
|
112
|
+
migration: "migration";
|
|
113
|
+
equivalence: "equivalence";
|
|
114
|
+
intake: "intake";
|
|
115
|
+
ux: "ux";
|
|
116
|
+
artifact_generation: "artifact_generation";
|
|
117
|
+
reconstruction: "reconstruction";
|
|
118
|
+
}>;
|
|
119
|
+
command: z.ZodString;
|
|
120
|
+
status: z.ZodEnum<{
|
|
121
|
+
blocked: "blocked";
|
|
122
|
+
warning: "warning";
|
|
123
|
+
failed: "failed";
|
|
124
|
+
passed: "passed";
|
|
125
|
+
skipped: "skipped";
|
|
126
|
+
}>;
|
|
127
|
+
evidence_ref: z.ZodOptional<z.ZodString>;
|
|
128
|
+
issue_codes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
export declare const reversaEvidenceBundleSchema: z.ZodObject<{
|
|
131
|
+
schema_version: z.ZodLiteral<1>;
|
|
132
|
+
contract: z.ZodLiteral<"reversa-evidence-bundle/v1">;
|
|
133
|
+
operation_id: z.ZodString;
|
|
134
|
+
generated_at: z.ZodString;
|
|
135
|
+
feature_ref: z.ZodString;
|
|
136
|
+
mode: z.ZodEnum<{
|
|
137
|
+
validate: "validate";
|
|
138
|
+
"read-only": "read-only";
|
|
139
|
+
plan: "plan";
|
|
140
|
+
"apply-sandbox": "apply-sandbox";
|
|
141
|
+
"apply-approved": "apply-approved";
|
|
142
|
+
}>;
|
|
143
|
+
source_attestations: z.ZodArray<z.ZodObject<{
|
|
144
|
+
source_ref: z.ZodString;
|
|
145
|
+
source_type: z.ZodEnum<{
|
|
146
|
+
config: "config";
|
|
147
|
+
repository: "repository";
|
|
148
|
+
document: "document";
|
|
149
|
+
runtime_log: "runtime_log";
|
|
150
|
+
database_schema: "database_schema";
|
|
151
|
+
manual_note: "manual_note";
|
|
152
|
+
}>;
|
|
153
|
+
trust_level: z.ZodEnum<{
|
|
154
|
+
trusted: "trusted";
|
|
155
|
+
untrusted: "untrusted";
|
|
156
|
+
hostile: "hostile";
|
|
157
|
+
}>;
|
|
158
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
159
|
+
redaction_status: z.ZodEnum<{
|
|
160
|
+
blocked: "blocked";
|
|
161
|
+
redacted: "redacted";
|
|
162
|
+
not_required: "not_required";
|
|
163
|
+
}>;
|
|
164
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
phase: z.ZodEnum<{
|
|
169
|
+
architecture: "architecture";
|
|
170
|
+
surface: "surface";
|
|
171
|
+
rules: "rules";
|
|
172
|
+
data: "data";
|
|
173
|
+
migration: "migration";
|
|
174
|
+
equivalence: "equivalence";
|
|
175
|
+
intake: "intake";
|
|
176
|
+
ux: "ux";
|
|
177
|
+
artifact_generation: "artifact_generation";
|
|
178
|
+
reconstruction: "reconstruction";
|
|
179
|
+
}>;
|
|
180
|
+
title: z.ZodString;
|
|
181
|
+
summary: z.ZodString;
|
|
182
|
+
confidence: z.ZodEnum<{
|
|
183
|
+
unknown: "unknown";
|
|
184
|
+
low: "low";
|
|
185
|
+
medium: "medium";
|
|
186
|
+
high: "high";
|
|
187
|
+
}>;
|
|
188
|
+
source_refs: z.ZodArray<z.ZodString>;
|
|
189
|
+
contradiction_refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
190
|
+
promoted_refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
191
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
192
|
+
}, z.core.$strip>>>;
|
|
193
|
+
artifacts: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
194
|
+
path: z.ZodString;
|
|
195
|
+
artifact_type: z.ZodEnum<{
|
|
196
|
+
inventory: "inventory";
|
|
197
|
+
architecture_map: "architecture_map";
|
|
198
|
+
business_rules: "business_rules";
|
|
199
|
+
data_model: "data_model";
|
|
200
|
+
ux_map: "ux_map";
|
|
201
|
+
generated_sdd_artifact: "generated_sdd_artifact";
|
|
202
|
+
migration_plan: "migration_plan";
|
|
203
|
+
reconstruction_diff: "reconstruction_diff";
|
|
204
|
+
equivalence_report: "equivalence_report";
|
|
205
|
+
question_set: "question_set";
|
|
206
|
+
}>;
|
|
207
|
+
phase: z.ZodEnum<{
|
|
208
|
+
architecture: "architecture";
|
|
209
|
+
surface: "surface";
|
|
210
|
+
rules: "rules";
|
|
211
|
+
data: "data";
|
|
212
|
+
migration: "migration";
|
|
213
|
+
equivalence: "equivalence";
|
|
214
|
+
intake: "intake";
|
|
215
|
+
ux: "ux";
|
|
216
|
+
artifact_generation: "artifact_generation";
|
|
217
|
+
reconstruction: "reconstruction";
|
|
218
|
+
}>;
|
|
219
|
+
checksum_sha256: z.ZodOptional<z.ZodString>;
|
|
220
|
+
produced_by: z.ZodString;
|
|
221
|
+
write_scope: z.ZodEnum<{
|
|
222
|
+
dry_run: "dry_run";
|
|
223
|
+
read_only: "read_only";
|
|
224
|
+
sandbox: "sandbox";
|
|
225
|
+
approved_apply: "approved_apply";
|
|
226
|
+
}>;
|
|
227
|
+
}, z.core.$strip>>>;
|
|
228
|
+
validations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
229
|
+
id: z.ZodString;
|
|
230
|
+
phase: z.ZodEnum<{
|
|
231
|
+
architecture: "architecture";
|
|
232
|
+
surface: "surface";
|
|
233
|
+
rules: "rules";
|
|
234
|
+
data: "data";
|
|
235
|
+
migration: "migration";
|
|
236
|
+
equivalence: "equivalence";
|
|
237
|
+
intake: "intake";
|
|
238
|
+
ux: "ux";
|
|
239
|
+
artifact_generation: "artifact_generation";
|
|
240
|
+
reconstruction: "reconstruction";
|
|
241
|
+
}>;
|
|
242
|
+
command: z.ZodString;
|
|
243
|
+
status: z.ZodEnum<{
|
|
244
|
+
blocked: "blocked";
|
|
245
|
+
warning: "warning";
|
|
246
|
+
failed: "failed";
|
|
247
|
+
passed: "passed";
|
|
248
|
+
skipped: "skipped";
|
|
249
|
+
}>;
|
|
250
|
+
evidence_ref: z.ZodOptional<z.ZodString>;
|
|
251
|
+
issue_codes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
252
|
+
}, z.core.$strip>>>;
|
|
253
|
+
contradictions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
254
|
+
id: z.ZodString;
|
|
255
|
+
finding_refs: z.ZodArray<z.ZodString>;
|
|
256
|
+
summary: z.ZodString;
|
|
257
|
+
resolution_status: z.ZodEnum<{
|
|
258
|
+
accepted_risk: "accepted_risk";
|
|
259
|
+
resolved: "resolved";
|
|
260
|
+
open: "open";
|
|
261
|
+
}>;
|
|
262
|
+
}, z.core.$strip>>>;
|
|
263
|
+
human_questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
question: z.ZodString;
|
|
266
|
+
blocks_phase: z.ZodOptional<z.ZodEnum<{
|
|
267
|
+
architecture: "architecture";
|
|
268
|
+
surface: "surface";
|
|
269
|
+
rules: "rules";
|
|
270
|
+
data: "data";
|
|
271
|
+
migration: "migration";
|
|
272
|
+
equivalence: "equivalence";
|
|
273
|
+
intake: "intake";
|
|
274
|
+
ux: "ux";
|
|
275
|
+
artifact_generation: "artifact_generation";
|
|
276
|
+
reconstruction: "reconstruction";
|
|
277
|
+
}>>;
|
|
278
|
+
required_before_apply: z.ZodDefault<z.ZodBoolean>;
|
|
279
|
+
}, z.core.$strip>>>;
|
|
280
|
+
quality_refs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
281
|
+
residual_risks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
282
|
+
code: z.ZodString;
|
|
283
|
+
severity: z.ZodEnum<{
|
|
284
|
+
low: "low";
|
|
285
|
+
medium: "medium";
|
|
286
|
+
high: "high";
|
|
287
|
+
critical: "critical";
|
|
288
|
+
}>;
|
|
289
|
+
description: z.ZodString;
|
|
290
|
+
mitigation: z.ZodString;
|
|
291
|
+
}, z.core.$strip>>>;
|
|
292
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
export type ReversaEvidenceBundle = z.infer<typeof reversaEvidenceBundleSchema>;
|
|
295
|
+
export type ReversaEvidencePhase = z.infer<typeof reversaEvidencePhaseSchema>;
|
|
296
|
+
export type ReversaSourceAttestation = z.infer<typeof reversaSourceAttestationSchema>;
|
|
297
|
+
export declare function parseReversaEvidenceBundle(input: unknown): ReversaEvidenceBundle;
|
|
298
|
+
//# sourceMappingURL=reversa-evidence.d.ts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const FEATURE_REF_PATTERN = /^FEAT-\d{4}$/;
|
|
3
|
+
const OPERATION_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
4
|
+
const WINDOWS_ABSOLUTE_PATH_PATTERN = /^[A-Za-z]:[\\/]/;
|
|
5
|
+
const jsonObjectSchema = z.record(z.string(), z.unknown());
|
|
6
|
+
const safeRelativePathSchema = z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.refine((value) => isSafeRelativePath(value), {
|
|
10
|
+
message: 'Path must be relative to the project root and must not contain traversal segments.',
|
|
11
|
+
});
|
|
12
|
+
export const reversaEvidencePhaseSchema = z.enum([
|
|
13
|
+
'intake',
|
|
14
|
+
'surface',
|
|
15
|
+
'architecture',
|
|
16
|
+
'rules',
|
|
17
|
+
'data',
|
|
18
|
+
'ux',
|
|
19
|
+
'artifact_generation',
|
|
20
|
+
'migration',
|
|
21
|
+
'reconstruction',
|
|
22
|
+
'equivalence',
|
|
23
|
+
]);
|
|
24
|
+
export const reversaConfidenceSchema = z.enum(['high', 'medium', 'low', 'unknown']);
|
|
25
|
+
export const reversaSourceAttestationSchema = z.object({
|
|
26
|
+
source_ref: safeRelativePathSchema,
|
|
27
|
+
source_type: z.enum(['repository', 'document', 'config', 'runtime_log', 'database_schema', 'manual_note']),
|
|
28
|
+
trust_level: z.enum(['trusted', 'untrusted', 'hostile']),
|
|
29
|
+
sha256: z.string().min(1).optional(),
|
|
30
|
+
redaction_status: z.enum(['not_required', 'redacted', 'blocked']),
|
|
31
|
+
notes: z.string().min(1).optional(),
|
|
32
|
+
});
|
|
33
|
+
export const reversaEvidenceFindingSchema = z.object({
|
|
34
|
+
id: z.string().regex(/^REV-FIND-[A-Z0-9-]+$/),
|
|
35
|
+
phase: reversaEvidencePhaseSchema,
|
|
36
|
+
title: z.string().min(1),
|
|
37
|
+
summary: z.string().min(1),
|
|
38
|
+
confidence: reversaConfidenceSchema,
|
|
39
|
+
source_refs: z.array(safeRelativePathSchema).min(1),
|
|
40
|
+
contradiction_refs: z.array(z.string().min(1)).default([]),
|
|
41
|
+
promoted_refs: z.array(z.string().min(1)).default([]),
|
|
42
|
+
metadata: jsonObjectSchema.default({}),
|
|
43
|
+
});
|
|
44
|
+
export const reversaEvidenceArtifactSchema = z.object({
|
|
45
|
+
path: safeRelativePathSchema,
|
|
46
|
+
artifact_type: z.enum([
|
|
47
|
+
'inventory',
|
|
48
|
+
'architecture_map',
|
|
49
|
+
'business_rules',
|
|
50
|
+
'data_model',
|
|
51
|
+
'ux_map',
|
|
52
|
+
'generated_sdd_artifact',
|
|
53
|
+
'migration_plan',
|
|
54
|
+
'reconstruction_diff',
|
|
55
|
+
'equivalence_report',
|
|
56
|
+
'question_set',
|
|
57
|
+
]),
|
|
58
|
+
phase: reversaEvidencePhaseSchema,
|
|
59
|
+
checksum_sha256: z.string().min(1).optional(),
|
|
60
|
+
produced_by: z.string().min(1),
|
|
61
|
+
write_scope: z.enum(['read_only', 'dry_run', 'sandbox', 'approved_apply']),
|
|
62
|
+
});
|
|
63
|
+
export const reversaEvidenceValidationSchema = z.object({
|
|
64
|
+
id: z.string().regex(/^REV-VAL-[A-Z0-9-]+$/),
|
|
65
|
+
phase: reversaEvidencePhaseSchema,
|
|
66
|
+
command: z.string().min(1),
|
|
67
|
+
status: z.enum(['passed', 'warning', 'failed', 'blocked', 'skipped']),
|
|
68
|
+
evidence_ref: safeRelativePathSchema.optional(),
|
|
69
|
+
issue_codes: z.array(z.string().regex(/^[A-Z][A-Z0-9_]*$/)).default([]),
|
|
70
|
+
});
|
|
71
|
+
export const reversaEvidenceBundleSchema = z.object({
|
|
72
|
+
schema_version: z.literal(1),
|
|
73
|
+
contract: z.literal('reversa-evidence-bundle/v1'),
|
|
74
|
+
operation_id: z.string().regex(OPERATION_ID_PATTERN),
|
|
75
|
+
generated_at: z.string().datetime(),
|
|
76
|
+
feature_ref: z.string().regex(FEATURE_REF_PATTERN),
|
|
77
|
+
mode: z.enum(['read-only', 'plan', 'validate', 'apply-sandbox', 'apply-approved']),
|
|
78
|
+
source_attestations: z.array(reversaSourceAttestationSchema).min(1),
|
|
79
|
+
findings: z.array(reversaEvidenceFindingSchema).default([]),
|
|
80
|
+
artifacts: z.array(reversaEvidenceArtifactSchema).default([]),
|
|
81
|
+
validations: z.array(reversaEvidenceValidationSchema).default([]),
|
|
82
|
+
contradictions: z
|
|
83
|
+
.array(z.object({
|
|
84
|
+
id: z.string().regex(/^REV-CONTRA-[A-Z0-9-]+$/),
|
|
85
|
+
finding_refs: z.array(z.string().min(1)).min(2),
|
|
86
|
+
summary: z.string().min(1),
|
|
87
|
+
resolution_status: z.enum(['open', 'resolved', 'accepted_risk']),
|
|
88
|
+
}))
|
|
89
|
+
.default([]),
|
|
90
|
+
human_questions: z
|
|
91
|
+
.array(z.object({
|
|
92
|
+
id: z.string().regex(/^REV-Q-[A-Z0-9-]+$/),
|
|
93
|
+
question: z.string().min(1),
|
|
94
|
+
blocks_phase: reversaEvidencePhaseSchema.optional(),
|
|
95
|
+
required_before_apply: z.boolean().default(false),
|
|
96
|
+
}))
|
|
97
|
+
.default([]),
|
|
98
|
+
quality_refs: z.array(safeRelativePathSchema).default([]),
|
|
99
|
+
residual_risks: z
|
|
100
|
+
.array(z.object({
|
|
101
|
+
code: z.string().regex(/^[A-Z][A-Z0-9_]*$/),
|
|
102
|
+
severity: z.enum(['low', 'medium', 'high', 'critical']),
|
|
103
|
+
description: z.string().min(1),
|
|
104
|
+
mitigation: z.string().min(1),
|
|
105
|
+
}))
|
|
106
|
+
.default([]),
|
|
107
|
+
metadata: jsonObjectSchema.default({}),
|
|
108
|
+
});
|
|
109
|
+
export function parseReversaEvidenceBundle(input) {
|
|
110
|
+
return reversaEvidenceBundleSchema.parse(input);
|
|
111
|
+
}
|
|
112
|
+
function isSafeRelativePath(value) {
|
|
113
|
+
if (value.startsWith('/') || WINDOWS_ABSOLUTE_PATH_PATTERN.test(value)) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
return !value.split(/[\\/]+/u).some((segment) => segment === '..');
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=reversa-evidence.js.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReversaArtifactWritePlan } from './reversa-artifact-writer.js';
|
|
2
|
+
export interface ReversaReconstructionPlan {
|
|
3
|
+
schema_version: 1;
|
|
4
|
+
contract: 'reversa-reconstruction-plan/v1';
|
|
5
|
+
feature_ref: string;
|
|
6
|
+
mode: 'apply-sandbox' | 'apply-approved';
|
|
7
|
+
status: 'ready' | 'blocked';
|
|
8
|
+
migration_steps: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
description: string;
|
|
11
|
+
evidence_ref: string;
|
|
12
|
+
}>;
|
|
13
|
+
sandbox_writes: Array<{
|
|
14
|
+
path: string;
|
|
15
|
+
source_draft_ref: string;
|
|
16
|
+
}>;
|
|
17
|
+
rollback_manifest: {
|
|
18
|
+
required: true;
|
|
19
|
+
path: string;
|
|
20
|
+
rollback_steps: string[];
|
|
21
|
+
};
|
|
22
|
+
blocked_reasons: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function buildReversaReconstructionPlan(input: {
|
|
25
|
+
writePlan: ReversaArtifactWritePlan;
|
|
26
|
+
mode: 'apply-sandbox' | 'apply-approved';
|
|
27
|
+
approval?: 'reversa-apply';
|
|
28
|
+
}): ReversaReconstructionPlan;
|
|
29
|
+
//# sourceMappingURL=reversa-reconstruction.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function buildReversaReconstructionPlan(input) {
|
|
2
|
+
const blockedReasons = [];
|
|
3
|
+
if (input.writePlan.status === 'needs_clarification') {
|
|
4
|
+
blockedReasons.push('Human clarification is required before reconstruction.');
|
|
5
|
+
}
|
|
6
|
+
if (input.mode === 'apply-approved' && input.approval !== 'reversa-apply') {
|
|
7
|
+
blockedReasons.push('apply-approved reconstruction requires reversa-apply approval.');
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
schema_version: 1,
|
|
11
|
+
contract: 'reversa-reconstruction-plan/v1',
|
|
12
|
+
feature_ref: input.writePlan.feature_ref,
|
|
13
|
+
mode: input.mode,
|
|
14
|
+
status: blockedReasons.length === 0 ? 'ready' : 'blocked',
|
|
15
|
+
migration_steps: input.writePlan.draft_artifacts.map((artifact, index) => ({
|
|
16
|
+
id: `REV-MIG-${String(index + 1).padStart(3, '0')}`,
|
|
17
|
+
description: `Review and reconstruct ${artifact.title} from ${artifact.source_finding_ref}.`,
|
|
18
|
+
evidence_ref: artifact.path,
|
|
19
|
+
})),
|
|
20
|
+
sandbox_writes: input.writePlan.draft_artifacts.map((artifact) => ({
|
|
21
|
+
path: `.sdd/evidence/reversa/${input.writePlan.feature_ref}/sandbox/${artifact.source_finding_ref.toLowerCase()}.yaml`,
|
|
22
|
+
source_draft_ref: artifact.path,
|
|
23
|
+
})),
|
|
24
|
+
rollback_manifest: {
|
|
25
|
+
required: true,
|
|
26
|
+
path: `.sdd/evidence/reversa/${input.writePlan.feature_ref}/rollback-manifest.yaml`,
|
|
27
|
+
rollback_steps: ['remove sandbox writes', 'restore previous generated drafts', 'rerun equivalence gate'],
|
|
28
|
+
},
|
|
29
|
+
blocked_reasons: blockedReasons,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=reversa-reconstruction.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReversaEvidenceBundle } from './reversa-evidence.js';
|
|
2
|
+
export interface ReversaRuleSource {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildReversaRulesInventory(input: {
|
|
7
|
+
featureRef: string;
|
|
8
|
+
operationId: string;
|
|
9
|
+
generatedAt: string;
|
|
10
|
+
sources: ReversaRuleSource[];
|
|
11
|
+
}): ReversaEvidenceBundle;
|
|
12
|
+
//# sourceMappingURL=reversa-rules-extractor.d.ts.map
|