graphitect 0.2.0__py3-none-any.whl
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.
- graphify/__init__.py +30 -0
- graphify/__main__.py +757 -0
- graphify/_minhash.py +107 -0
- graphify/affected.py +318 -0
- graphify/always_on/agents-md.md +12 -0
- graphify/always_on/antigravity-rules.md +14 -0
- graphify/always_on/claude-md.md +9 -0
- graphify/always_on/gemini-md.md +9 -0
- graphify/always_on/kiro-steering.md +5 -0
- graphify/always_on/vscode-instructions.md +17 -0
- graphify/analyze.py +769 -0
- graphify/benchmark.py +152 -0
- graphify/build.py +2300 -0
- graphify/cache.py +1746 -0
- graphify/callflow_html.py +2051 -0
- graphify/cargo_introspect.py +109 -0
- graphify/cli.py +4745 -0
- graphify/cluster.py +409 -0
- graphify/command-kilo.md +15 -0
- graphify/cross_repo_calls.py +216 -0
- graphify/cross_repo_types.py +75 -0
- graphify/csharp_dispatch.py +154 -0
- graphify/dedup.py +1213 -0
- graphify/detect.py +2566 -0
- graphify/diagnostics.py +406 -0
- graphify/export.py +1349 -0
- graphify/exporters/__init__.py +1 -0
- graphify/exporters/base.py +14 -0
- graphify/exporters/graphdb.py +173 -0
- graphify/exporters/html.py +637 -0
- graphify/extract.py +7856 -0
- graphify/extractors/MIGRATION.md +107 -0
- graphify/extractors/__init__.py +66 -0
- graphify/extractors/apex.py +215 -0
- graphify/extractors/base.py +85 -0
- graphify/extractors/bash.py +579 -0
- graphify/extractors/blade.py +53 -0
- graphify/extractors/commonlisp.py +540 -0
- graphify/extractors/csharp.py +448 -0
- graphify/extractors/dart.py +564 -0
- graphify/extractors/dm.py +494 -0
- graphify/extractors/elixir.py +241 -0
- graphify/extractors/engine.py +6509 -0
- graphify/extractors/fortran.py +311 -0
- graphify/extractors/go.py +527 -0
- graphify/extractors/json_config.py +240 -0
- graphify/extractors/julia.py +289 -0
- graphify/extractors/markdown.py +408 -0
- graphify/extractors/models.py +131 -0
- graphify/extractors/objc.py +566 -0
- graphify/extractors/ocaml.py +289 -0
- graphify/extractors/pascal.py +688 -0
- graphify/extractors/pascal_forms.py +196 -0
- graphify/extractors/powershell.py +522 -0
- graphify/extractors/razor.py +192 -0
- graphify/extractors/resolution.py +3584 -0
- graphify/extractors/robot.py +296 -0
- graphify/extractors/rust.py +470 -0
- graphify/extractors/sln.py +92 -0
- graphify/extractors/sql.py +720 -0
- graphify/extractors/terraform.py +181 -0
- graphify/extractors/verilog.py +329 -0
- graphify/extractors/zig.py +181 -0
- graphify/file_slice.py +246 -0
- graphify/global_graph.py +194 -0
- graphify/google_workspace.py +237 -0
- graphify/hooks.py +933 -0
- graphify/ids.py +93 -0
- graphify/ingest.py +358 -0
- graphify/install.py +2366 -0
- graphify/llm.py +3544 -0
- graphify/manifest.py +4 -0
- graphify/manifest_ingest.py +311 -0
- graphify/mcp_ingest.py +386 -0
- graphify/multigraph_compat.py +212 -0
- graphify/pascal_resolution.py +129 -0
- graphify/paths.py +436 -0
- graphify/pg_introspect.py +165 -0
- graphify/prs.py +770 -0
- graphify/querylog.py +80 -0
- graphify/reflect.py +882 -0
- graphify/report.py +346 -0
- graphify/resolver_registry.py +85 -0
- graphify/ruby_resolution.py +242 -0
- graphify/scip_ingest.py +363 -0
- graphify/security.py +460 -0
- graphify/semantic_cleanup.py +336 -0
- graphify/serve.py +2608 -0
- graphify/skill-agents.md +710 -0
- graphify/skill-aider.md +1283 -0
- graphify/skill-amp.md +710 -0
- graphify/skill-claw.md +713 -0
- graphify/skill-codex.md +710 -0
- graphify/skill-copilot.md +713 -0
- graphify/skill-devin.md +1410 -0
- graphify/skill-droid.md +710 -0
- graphify/skill-kilo.md +722 -0
- graphify/skill-kiro.md +713 -0
- graphify/skill-opencode.md +705 -0
- graphify/skill-pi.md +713 -0
- graphify/skill-trae.md +711 -0
- graphify/skill-vscode.md +709 -0
- graphify/skill-windows.md +755 -0
- graphify/skill.md +713 -0
- graphify/skills/agents/references/add-watch.md +56 -0
- graphify/skills/agents/references/exports.md +87 -0
- graphify/skills/agents/references/extraction-spec.md +70 -0
- graphify/skills/agents/references/github-and-merge.md +46 -0
- graphify/skills/agents/references/hooks.md +33 -0
- graphify/skills/agents/references/query.md +311 -0
- graphify/skills/agents/references/transcribe.md +52 -0
- graphify/skills/agents/references/update.md +210 -0
- graphify/skills/amp/references/add-watch.md +56 -0
- graphify/skills/amp/references/exports.md +87 -0
- graphify/skills/amp/references/extraction-spec.md +70 -0
- graphify/skills/amp/references/github-and-merge.md +46 -0
- graphify/skills/amp/references/hooks.md +33 -0
- graphify/skills/amp/references/query.md +311 -0
- graphify/skills/amp/references/transcribe.md +52 -0
- graphify/skills/amp/references/update.md +210 -0
- graphify/skills/claude/references/add-watch.md +56 -0
- graphify/skills/claude/references/exports.md +87 -0
- graphify/skills/claude/references/extraction-spec.md +70 -0
- graphify/skills/claude/references/github-and-merge.md +46 -0
- graphify/skills/claude/references/hooks.md +33 -0
- graphify/skills/claude/references/query.md +311 -0
- graphify/skills/claude/references/transcribe.md +52 -0
- graphify/skills/claude/references/update.md +210 -0
- graphify/skills/claw/references/add-watch.md +56 -0
- graphify/skills/claw/references/exports.md +87 -0
- graphify/skills/claw/references/extraction-spec.md +31 -0
- graphify/skills/claw/references/github-and-merge.md +46 -0
- graphify/skills/claw/references/hooks.md +33 -0
- graphify/skills/claw/references/query.md +311 -0
- graphify/skills/claw/references/transcribe.md +52 -0
- graphify/skills/claw/references/update.md +210 -0
- graphify/skills/codex/references/add-watch.md +56 -0
- graphify/skills/codex/references/exports.md +87 -0
- graphify/skills/codex/references/extraction-spec.md +31 -0
- graphify/skills/codex/references/github-and-merge.md +46 -0
- graphify/skills/codex/references/hooks.md +33 -0
- graphify/skills/codex/references/query.md +311 -0
- graphify/skills/codex/references/transcribe.md +52 -0
- graphify/skills/codex/references/update.md +210 -0
- graphify/skills/copilot/references/add-watch.md +56 -0
- graphify/skills/copilot/references/exports.md +87 -0
- graphify/skills/copilot/references/extraction-spec.md +70 -0
- graphify/skills/copilot/references/github-and-merge.md +46 -0
- graphify/skills/copilot/references/hooks.md +33 -0
- graphify/skills/copilot/references/query.md +311 -0
- graphify/skills/copilot/references/transcribe.md +52 -0
- graphify/skills/copilot/references/update.md +210 -0
- graphify/skills/droid/references/add-watch.md +56 -0
- graphify/skills/droid/references/exports.md +87 -0
- graphify/skills/droid/references/extraction-spec.md +70 -0
- graphify/skills/droid/references/github-and-merge.md +46 -0
- graphify/skills/droid/references/hooks.md +33 -0
- graphify/skills/droid/references/query.md +311 -0
- graphify/skills/droid/references/transcribe.md +52 -0
- graphify/skills/droid/references/update.md +210 -0
- graphify/skills/kilo/references/add-watch.md +56 -0
- graphify/skills/kilo/references/exports.md +87 -0
- graphify/skills/kilo/references/extraction-spec.md +70 -0
- graphify/skills/kilo/references/github-and-merge.md +46 -0
- graphify/skills/kilo/references/hooks.md +33 -0
- graphify/skills/kilo/references/query.md +311 -0
- graphify/skills/kilo/references/transcribe.md +52 -0
- graphify/skills/kilo/references/update.md +210 -0
- graphify/skills/kiro/references/add-watch.md +56 -0
- graphify/skills/kiro/references/exports.md +87 -0
- graphify/skills/kiro/references/extraction-spec.md +31 -0
- graphify/skills/kiro/references/github-and-merge.md +46 -0
- graphify/skills/kiro/references/hooks.md +33 -0
- graphify/skills/kiro/references/query.md +311 -0
- graphify/skills/kiro/references/transcribe.md +52 -0
- graphify/skills/kiro/references/update.md +210 -0
- graphify/skills/opencode/references/add-watch.md +56 -0
- graphify/skills/opencode/references/exports.md +87 -0
- graphify/skills/opencode/references/extraction-spec.md +70 -0
- graphify/skills/opencode/references/github-and-merge.md +46 -0
- graphify/skills/opencode/references/hooks.md +33 -0
- graphify/skills/opencode/references/query.md +311 -0
- graphify/skills/opencode/references/transcribe.md +52 -0
- graphify/skills/opencode/references/update.md +210 -0
- graphify/skills/pi/references/add-watch.md +56 -0
- graphify/skills/pi/references/exports.md +87 -0
- graphify/skills/pi/references/extraction-spec.md +31 -0
- graphify/skills/pi/references/github-and-merge.md +46 -0
- graphify/skills/pi/references/hooks.md +33 -0
- graphify/skills/pi/references/query.md +311 -0
- graphify/skills/pi/references/transcribe.md +52 -0
- graphify/skills/pi/references/update.md +210 -0
- graphify/skills/trae/references/add-watch.md +56 -0
- graphify/skills/trae/references/exports.md +87 -0
- graphify/skills/trae/references/extraction-spec.md +70 -0
- graphify/skills/trae/references/github-and-merge.md +46 -0
- graphify/skills/trae/references/hooks.md +35 -0
- graphify/skills/trae/references/query.md +311 -0
- graphify/skills/trae/references/transcribe.md +52 -0
- graphify/skills/trae/references/update.md +210 -0
- graphify/skills/vscode/references/add-watch.md +56 -0
- graphify/skills/vscode/references/exports.md +87 -0
- graphify/skills/vscode/references/extraction-spec.md +70 -0
- graphify/skills/vscode/references/github-and-merge.md +46 -0
- graphify/skills/vscode/references/hooks.md +33 -0
- graphify/skills/vscode/references/query.md +311 -0
- graphify/skills/vscode/references/transcribe.md +52 -0
- graphify/skills/vscode/references/update.md +210 -0
- graphify/skills/windows/references/add-watch.md +56 -0
- graphify/skills/windows/references/exports.md +87 -0
- graphify/skills/windows/references/extraction-spec.md +70 -0
- graphify/skills/windows/references/github-and-merge.md +46 -0
- graphify/skills/windows/references/hooks.md +33 -0
- graphify/skills/windows/references/query.md +311 -0
- graphify/skills/windows/references/transcribe.md +52 -0
- graphify/skills/windows/references/update.md +210 -0
- graphify/symbol_resolution.py +556 -0
- graphify/transcribe.py +186 -0
- graphify/tree_html.py +603 -0
- graphify/validate.py +95 -0
- graphify/watch.py +2280 -0
- graphify/wiki.py +405 -0
- graphitect/__init__.py +28 -0
- graphitect/__main__.py +4 -0
- graphitect/_vendor/__init__.py +2 -0
- graphitect/_vendor/archify/LICENSE +22 -0
- graphitect/_vendor/archify/SKILL.md +137 -0
- graphitect/_vendor/archify/THIRD_PARTY_NOTICES.md +69 -0
- graphitect/_vendor/archify/assets/JetBrainsMono-OFL.txt +93 -0
- graphitect/_vendor/archify/assets/template.html +14935 -0
- graphitect/_vendor/archify/bin/archify.mjs +2091 -0
- graphitect/_vendor/archify/bin/open-artifact.mjs +86 -0
- graphitect/_vendor/archify/bin/preview.mjs +653 -0
- graphitect/_vendor/archify/bin/visual-check.mjs +829 -0
- graphitect/_vendor/archify/brand-marks/README.md +31 -0
- graphitect/_vendor/archify/brand-marks/catalog.json +131 -0
- graphitect/_vendor/archify/delta/architecture-delta.mjs +1221 -0
- graphitect/_vendor/archify/examples/agent-run.lifecycle.json +60 -0
- graphitect/_vendor/archify/examples/agent-tool-call.workflow.json +94 -0
- graphitect/_vendor/archify/examples/async-job-roundtrip.sequence.json +61 -0
- graphitect/_vendor/archify/examples/brand-aware-delivery.architecture.json +47 -0
- graphitect/_vendor/archify/examples/cache-miss-request.sequence.json +82 -0
- graphitect/_vendor/archify/examples/checkout-platform.base.architecture.json +31 -0
- graphitect/_vendor/archify/examples/checkout-platform.head.architecture.json +31 -0
- graphitect/_vendor/archify/examples/dataflow-product-analytics.html +15045 -0
- graphitect/_vendor/archify/examples/deployment-release.lifecycle.json +49 -0
- graphitect/_vendor/archify/examples/event-stream.dataflow.json +57 -0
- graphitect/_vendor/archify/examples/incident-response.workflow.json +64 -0
- graphitect/_vendor/archify/examples/lifecycle-agent-run.html +14980 -0
- graphitect/_vendor/archify/examples/product-analytics.dataflow.json +76 -0
- graphitect/_vendor/archify/examples/production-deployment.architecture.json +71 -0
- graphitect/_vendor/archify/examples/release-delivery.workflow.json +62 -0
- graphitect/_vendor/archify/examples/sequence-cache-miss-request.html +15060 -0
- graphitect/_vendor/archify/examples/web-app-rendered.html +15009 -0
- graphitect/_vendor/archify/examples/web-app.architecture.json +46 -0
- graphitect/_vendor/archify/examples/workflow-agent-tool-call-rendered.html +15051 -0
- graphitect/_vendor/archify/migrations/workflow-v2.mjs +279 -0
- graphitect/_vendor/archify/package-lock.json +149 -0
- graphitect/_vendor/archify/package.json +39 -0
- graphitect/_vendor/archify/recipes/scenarios.mjs +391 -0
- graphitect/_vendor/archify/references/authoring-contract.md +243 -0
- graphitect/_vendor/archify/references/brand-marks.md +65 -0
- graphitect/_vendor/archify/references/delivery-contract.md +120 -0
- graphitect/_vendor/archify/references/viewer-runtime.md +45 -0
- graphitect/_vendor/archify/renderers/architecture/grid.mjs +62 -0
- graphitect/_vendor/archify/renderers/architecture/render-architecture.mjs +1078 -0
- graphitect/_vendor/archify/renderers/dataflow/README.md +104 -0
- graphitect/_vendor/archify/renderers/dataflow/render-dataflow.mjs +483 -0
- graphitect/_vendor/archify/renderers/lifecycle/README.md +115 -0
- graphitect/_vendor/archify/renderers/lifecycle/render-lifecycle.mjs +561 -0
- graphitect/_vendor/archify/renderers/sequence/README.md +114 -0
- graphitect/_vendor/archify/renderers/sequence/render-sequence.mjs +464 -0
- graphitect/_vendor/archify/renderers/shared/brand-marks.mjs +563 -0
- graphitect/_vendor/archify/renderers/shared/cli.mjs +218 -0
- graphitect/_vendor/archify/renderers/shared/desktop-readability.mjs +26 -0
- graphitect/_vendor/archify/renderers/shared/diagnostics.mjs +127 -0
- graphitect/_vendor/archify/renderers/shared/engineering-profiles.mjs +157 -0
- graphitect/_vendor/archify/renderers/shared/generated-brand-marks.mjs +2003 -0
- graphitect/_vendor/archify/renderers/shared/generated-validators.mjs +13 -0
- graphitect/_vendor/archify/renderers/shared/geometry.mjs +1423 -0
- graphitect/_vendor/archify/renderers/shared/i18n.mjs +595 -0
- graphitect/_vendor/archify/renderers/shared/layout-report.mjs +40 -0
- graphitect/_vendor/archify/renderers/shared/legend.mjs +217 -0
- graphitect/_vendor/archify/renderers/shared/output-path.mjs +340 -0
- graphitect/_vendor/archify/renderers/shared/repository-evidence.mjs +238 -0
- graphitect/_vendor/archify/renderers/shared/repository-location.mjs +58 -0
- graphitect/_vendor/archify/renderers/shared/text-fit.mjs +49 -0
- graphitect/_vendor/archify/renderers/shared/utils.mjs +232 -0
- graphitect/_vendor/archify/renderers/shared/validator.mjs +86 -0
- graphitect/_vendor/archify/renderers/workflow/README.md +223 -0
- graphitect/_vendor/archify/renderers/workflow/render-workflow.mjs +35 -0
- graphitect/_vendor/archify/renderers/workflow/workflow-compiler.mjs +4400 -0
- graphitect/_vendor/archify/renderers/workflow/workflow-migration-geometry.mjs +144 -0
- graphitect/_vendor/archify/schemas/README.md +211 -0
- graphitect/_vendor/archify/schemas/architecture.schema.json +178 -0
- graphitect/_vendor/archify/schemas/common.schema.json +115 -0
- graphitect/_vendor/archify/schemas/dataflow.schema.json +243 -0
- graphitect/_vendor/archify/schemas/lifecycle.schema.json +266 -0
- graphitect/_vendor/archify/schemas/sequence.schema.json +223 -0
- graphitect/_vendor/archify/schemas/workflow.schema.json +428 -0
- graphitect/_vendor/archify/scripts/check-render-output.mjs +836 -0
- graphitect/_vendor/archify/scripts/check-update.mjs +1667 -0
- graphitect/_vendor/archify/scripts/generate-brand-marks.mjs +141 -0
- graphitect/_vendor/archify/scripts/generate-validators.mjs +66 -0
- graphitect/_vendor/archify/scripts/render-examples.mjs +26 -0
- graphitect/_vendor/archify/scripts/update-contract.mjs +182 -0
- graphitect/_vendor/archify/skill-release.json +10 -0
- graphitect/cli.py +981 -0
- graphitect/deliver/__init__.py +5 -0
- graphitect/deliver/archify_adapter.py +1877 -0
- graphitect/deliver/archify_ir.py +160 -0
- graphitect/deliver/archify_repair.py +135 -0
- graphitect/deliver/doc_compiler.py +916 -0
- graphitect/ground/__init__.py +5 -0
- graphitect/ground/describe_source.py +27 -0
- graphitect/ground/fullread_source.py +56 -0
- graphitect/ground/graphify_source.py +107 -0
- graphitect/models.py +118 -0
- graphitect/skill/SKILL.md +80 -0
- graphitect/skill/agents/openai.yaml +4 -0
- graphitect/synthesize/__init__.py +5 -0
- graphitect/synthesize/engine.py +281 -0
- graphitect/synthesize/llm_backend.py +331 -0
- graphitect/synthesize/questions.py +139 -0
- graphitect/synthesize/rubric.py +104 -0
- graphitect-0.2.0.dist-info/METADATA +284 -0
- graphitect-0.2.0.dist-info/RECORD +336 -0
- graphitect-0.2.0.dist-info/WHEEL +5 -0
- graphitect-0.2.0.dist-info/entry_points.txt +2 -0
- graphitect-0.2.0.dist-info/licenses/LICENSE +21 -0
- graphitect-0.2.0.dist-info/licenses/LICENSE-ARCHIFY-MIT +22 -0
- graphitect-0.2.0.dist-info/licenses/LICENSE-GRAPHIFY-APACHE-2.0 +202 -0
- graphitect-0.2.0.dist-info/licenses/LICENSE-GRAPHIFY-MIT +21 -0
- graphitect-0.2.0.dist-info/licenses/NOTICE-ARCHIFY-THIRD-PARTY.md +69 -0
- graphitect-0.2.0.dist-info/licenses/NOTICE-GRAPHIFY +8 -0
- graphitect-0.2.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { compileWorkflow } from '../renderers/workflow/workflow-compiler.mjs';
|
|
2
|
+
import {
|
|
3
|
+
createMappedWorkflowCandidate,
|
|
4
|
+
intrinsicWorkflow,
|
|
5
|
+
planningWorkflow,
|
|
6
|
+
} from '../renderers/workflow/workflow-migration-geometry.mjs';
|
|
7
|
+
import { validateSchema } from '../renderers/shared/validator.mjs';
|
|
8
|
+
|
|
9
|
+
export { createHorizontalRankMapper } from '../renderers/workflow/workflow-migration-geometry.mjs';
|
|
10
|
+
|
|
11
|
+
const TARGET_SCHEMA_VERSION = 2;
|
|
12
|
+
|
|
13
|
+
function clone(value) {
|
|
14
|
+
return JSON.parse(JSON.stringify(value));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function diagnostic({ code, message, subject = {}, evidence = {}, supportedFixes = [] }) {
|
|
18
|
+
return {
|
|
19
|
+
code,
|
|
20
|
+
severity: 'error',
|
|
21
|
+
message,
|
|
22
|
+
subject,
|
|
23
|
+
evidence,
|
|
24
|
+
supportedFixes,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function schemaDiagnostics(workflow) {
|
|
29
|
+
try {
|
|
30
|
+
validateSchema('workflow', workflow);
|
|
31
|
+
return [];
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (Array.isArray(error?.archifyDiagnostics)) {
|
|
34
|
+
return error.archifyDiagnostics.map((entry) => ({ ...entry }));
|
|
35
|
+
}
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function legacyLayoutProbe(workflow, qualityProfile) {
|
|
41
|
+
// The probe discovers fixed-v1 rank centers, not authored canvas capacity.
|
|
42
|
+
// Omitting viewBox lets a capacity-only legacy failure reach the v2 compiler,
|
|
43
|
+
// which can measure and monotonically expand the real migrated document.
|
|
44
|
+
const probe = {
|
|
45
|
+
schema_version: 1,
|
|
46
|
+
diagram_type: 'workflow',
|
|
47
|
+
meta: {
|
|
48
|
+
title: workflow.meta.title,
|
|
49
|
+
...(workflow.meta.locale ? { locale: workflow.meta.locale } : {}),
|
|
50
|
+
legend: { mode: 'hidden' },
|
|
51
|
+
},
|
|
52
|
+
lanes: clone(workflow.lanes),
|
|
53
|
+
nodes: [{
|
|
54
|
+
id: 'migration_probe',
|
|
55
|
+
lane: workflow.lanes[0].id,
|
|
56
|
+
col: 0,
|
|
57
|
+
type: 'backend',
|
|
58
|
+
label: 'Probe',
|
|
59
|
+
}],
|
|
60
|
+
edges: [],
|
|
61
|
+
};
|
|
62
|
+
return compileWorkflow({ workflow: probe, qualityProfile });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function legacyRequirementProbe(workflow, qualityProfile) {
|
|
66
|
+
// Measure the complete fixed-v1 document without treating an authored
|
|
67
|
+
// viewBox as its intrinsic requirement. The authored viewBox remains a
|
|
68
|
+
// migration capacity and is preserved separately on the migrated document.
|
|
69
|
+
const probe = clone(workflow);
|
|
70
|
+
delete probe.meta.viewBox;
|
|
71
|
+
return compileWorkflow({ workflow: probe, qualityProfile });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function requiredViewBoxFrom(result) {
|
|
75
|
+
if (Array.isArray(result?.receipt?.requiredViewBox)) {
|
|
76
|
+
return [...result.receipt.requiredViewBox];
|
|
77
|
+
}
|
|
78
|
+
const required = result?.diagnostics
|
|
79
|
+
?.map((entry) => entry?.evidence?.requiredViewBox)
|
|
80
|
+
.find((candidate) => Array.isArray(candidate) && candidate.length === 2);
|
|
81
|
+
return required ? [...required] : null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function expandableViewBox(result) {
|
|
85
|
+
if (result.ok || !result.diagnostics?.length) return null;
|
|
86
|
+
if (!result.diagnostics.every((entry) => entry.code === 'workflow/viewbox-capacity')) return null;
|
|
87
|
+
return requiredViewBoxFrom(result);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function result({
|
|
91
|
+
ok,
|
|
92
|
+
document,
|
|
93
|
+
fromSchemaVersion = 1,
|
|
94
|
+
preExistingDiagnostics = [],
|
|
95
|
+
migrationDiagnostics = [],
|
|
96
|
+
newSchemaDiagnostics = [],
|
|
97
|
+
changedCoordinates = [],
|
|
98
|
+
oldRequiredViewBox = null,
|
|
99
|
+
newRequiredViewBox = null,
|
|
100
|
+
}) {
|
|
101
|
+
return {
|
|
102
|
+
ok,
|
|
103
|
+
...(document ? { document } : {}),
|
|
104
|
+
fromSchemaVersion,
|
|
105
|
+
toSchemaVersion: TARGET_SCHEMA_VERSION,
|
|
106
|
+
preExistingDiagnostics,
|
|
107
|
+
migrationDiagnostics,
|
|
108
|
+
newSchemaDiagnostics,
|
|
109
|
+
changedCoordinates,
|
|
110
|
+
oldRequiredViewBox,
|
|
111
|
+
newRequiredViewBox,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function migrateWorkflowDocument(inputWorkflow) {
|
|
116
|
+
if (!inputWorkflow || typeof inputWorkflow !== 'object' || Array.isArray(inputWorkflow)) {
|
|
117
|
+
return result({
|
|
118
|
+
ok: false,
|
|
119
|
+
migrationDiagnostics: [diagnostic({
|
|
120
|
+
code: 'migration/source-document',
|
|
121
|
+
message: 'Workflow migration requires one parsed JSON object.',
|
|
122
|
+
supportedFixes: ['provide one workflow schema v1 JSON document'],
|
|
123
|
+
})],
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// Migration has no quality override: the authored policy (or effective
|
|
127
|
+
// standard default) must validate the document after it leaves this process.
|
|
128
|
+
const qualityProfile = inputWorkflow.meta?.quality_profile || 'standard';
|
|
129
|
+
|
|
130
|
+
const workflow = clone(inputWorkflow);
|
|
131
|
+
const preExistingDiagnostics = schemaDiagnostics(workflow);
|
|
132
|
+
if (preExistingDiagnostics.length) {
|
|
133
|
+
return result({
|
|
134
|
+
ok: false,
|
|
135
|
+
fromSchemaVersion: workflow.schema_version,
|
|
136
|
+
preExistingDiagnostics,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (workflow.schema_version === TARGET_SCHEMA_VERSION) {
|
|
140
|
+
const compiled = compileWorkflow({ workflow: clone(workflow), qualityProfile });
|
|
141
|
+
const requiredViewBox = requiredViewBoxFrom(compiled);
|
|
142
|
+
if (!compiled.ok) {
|
|
143
|
+
return result({
|
|
144
|
+
ok: false,
|
|
145
|
+
fromSchemaVersion: TARGET_SCHEMA_VERSION,
|
|
146
|
+
preExistingDiagnostics: compiled.diagnostics,
|
|
147
|
+
oldRequiredViewBox: requiredViewBox,
|
|
148
|
+
newRequiredViewBox: requiredViewBox,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return result({
|
|
152
|
+
ok: true,
|
|
153
|
+
document: workflow,
|
|
154
|
+
fromSchemaVersion: TARGET_SCHEMA_VERSION,
|
|
155
|
+
oldRequiredViewBox: requiredViewBox,
|
|
156
|
+
newRequiredViewBox: requiredViewBox,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (workflow.schema_version !== 1) {
|
|
160
|
+
return result({
|
|
161
|
+
ok: false,
|
|
162
|
+
fromSchemaVersion: workflow.schema_version,
|
|
163
|
+
migrationDiagnostics: [diagnostic({
|
|
164
|
+
code: 'migration/source-schema-version',
|
|
165
|
+
message: 'Workflow migration to schema v2 requires a schema v1 or v2 source.',
|
|
166
|
+
subject: { path: '/schema_version' },
|
|
167
|
+
evidence: { actual: workflow.schema_version, expected: [1, 2] },
|
|
168
|
+
supportedFixes: ['use an unchanged schema v1 workflow or an already migrated schema v2 workflow as the source'],
|
|
169
|
+
})],
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const legacy = compileWorkflow({ workflow: clone(workflow), qualityProfile });
|
|
174
|
+
const legacyProbe = legacyLayoutProbe(workflow, qualityProfile);
|
|
175
|
+
if (!legacyProbe.ok) {
|
|
176
|
+
return result({
|
|
177
|
+
ok: false,
|
|
178
|
+
preExistingDiagnostics: legacy.ok ? [] : legacy.diagnostics,
|
|
179
|
+
migrationDiagnostics: legacyProbe.diagnostics,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
const legacyRequirement = legacyRequirementProbe(workflow, qualityProfile);
|
|
183
|
+
const oldRequiredViewBox = requiredViewBoxFrom(legacyRequirement)
|
|
184
|
+
|| requiredViewBoxFrom(legacyProbe)
|
|
185
|
+
|| requiredViewBoxFrom(legacy);
|
|
186
|
+
const preExistingLayoutDiagnostics = legacy.ok ? [] : legacy.diagnostics;
|
|
187
|
+
|
|
188
|
+
let planned = compileWorkflow({ workflow: intrinsicWorkflow(workflow), qualityProfile });
|
|
189
|
+
if (!planned.ok) {
|
|
190
|
+
// Old absolute pins can be invalid at the new rank centers before their X
|
|
191
|
+
// coordinates are mapped. Obtain the same rank plan from an automatic-route
|
|
192
|
+
// projection, then validate every authored pin again after mapping.
|
|
193
|
+
planned = compileWorkflow({ workflow: planningWorkflow(workflow), qualityProfile });
|
|
194
|
+
}
|
|
195
|
+
if (!planned.ok) {
|
|
196
|
+
return result({
|
|
197
|
+
ok: false,
|
|
198
|
+
preExistingDiagnostics: preExistingLayoutDiagnostics,
|
|
199
|
+
newSchemaDiagnostics: planned.diagnostics,
|
|
200
|
+
oldRequiredViewBox,
|
|
201
|
+
newRequiredViewBox: requiredViewBoxFrom(planned),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
let mappedCandidate;
|
|
206
|
+
try {
|
|
207
|
+
mappedCandidate = createMappedWorkflowCandidate(
|
|
208
|
+
workflow,
|
|
209
|
+
legacyProbe.receipt.columns,
|
|
210
|
+
planned.receipt.columns,
|
|
211
|
+
);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
return result({
|
|
214
|
+
ok: false,
|
|
215
|
+
preExistingDiagnostics: preExistingLayoutDiagnostics,
|
|
216
|
+
migrationDiagnostics: [diagnostic({
|
|
217
|
+
code: 'migration/rank-mapping',
|
|
218
|
+
message: 'Could not construct a stable horizontal rank mapping.',
|
|
219
|
+
evidence: { reason: error.message },
|
|
220
|
+
supportedFixes: ['report the workflow and compiler receipts to the Archify maintainers'],
|
|
221
|
+
})],
|
|
222
|
+
oldRequiredViewBox,
|
|
223
|
+
newRequiredViewBox: requiredViewBoxFrom(planned),
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const { document: migrated, changedCoordinates } = mappedCandidate;
|
|
228
|
+
|
|
229
|
+
let compiled = compileWorkflow({ workflow: migrated, qualityProfile });
|
|
230
|
+
const requiredExpansion = migrated.meta.viewBox ? expandableViewBox(compiled) : null;
|
|
231
|
+
if (requiredExpansion) {
|
|
232
|
+
const current = migrated.meta.viewBox;
|
|
233
|
+
const expanded = [
|
|
234
|
+
Math.max(current[0], requiredExpansion[0]),
|
|
235
|
+
Math.max(current[1], requiredExpansion[1]),
|
|
236
|
+
];
|
|
237
|
+
if (expanded[0] > current[0] || expanded[1] > current[1]) {
|
|
238
|
+
migrated.meta.viewBox = expanded;
|
|
239
|
+
compiled = compileWorkflow({ workflow: migrated, qualityProfile });
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const newRequiredViewBox = requiredViewBoxFrom(compiled) || requiredViewBoxFrom(planned);
|
|
244
|
+
if (!compiled.ok) {
|
|
245
|
+
return result({
|
|
246
|
+
ok: false,
|
|
247
|
+
preExistingDiagnostics: preExistingLayoutDiagnostics,
|
|
248
|
+
newSchemaDiagnostics: compiled.diagnostics,
|
|
249
|
+
changedCoordinates,
|
|
250
|
+
oldRequiredViewBox,
|
|
251
|
+
newRequiredViewBox,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const migratedSchemaDiagnostics = schemaDiagnostics(migrated);
|
|
256
|
+
if (migratedSchemaDiagnostics.length) {
|
|
257
|
+
return result({
|
|
258
|
+
ok: false,
|
|
259
|
+
preExistingDiagnostics: preExistingLayoutDiagnostics,
|
|
260
|
+
newSchemaDiagnostics: migratedSchemaDiagnostics,
|
|
261
|
+
changedCoordinates,
|
|
262
|
+
oldRequiredViewBox,
|
|
263
|
+
newRequiredViewBox,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return result({
|
|
268
|
+
ok: true,
|
|
269
|
+
document: migrated,
|
|
270
|
+
preExistingDiagnostics: preExistingLayoutDiagnostics,
|
|
271
|
+
changedCoordinates,
|
|
272
|
+
oldRequiredViewBox,
|
|
273
|
+
newRequiredViewBox,
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export function serializeMigratedWorkflow(workflow) {
|
|
278
|
+
return `${JSON.stringify(workflow, null, 2)}\n`;
|
|
279
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "archify",
|
|
3
|
+
"version": "2.17.0-dev.1",
|
|
4
|
+
"lockfileVersion": 3,
|
|
5
|
+
"requires": true,
|
|
6
|
+
"packages": {
|
|
7
|
+
"": {
|
|
8
|
+
"name": "archify",
|
|
9
|
+
"version": "2.17.0-dev.1",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bin": {
|
|
12
|
+
"archify": "bin/archify.mjs"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"ajv": "^8.17.1",
|
|
16
|
+
"parse5": "7.3.0",
|
|
17
|
+
"saxes": "6.0.0",
|
|
18
|
+
"simple-icons": "16.28.0"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"node_modules/ajv": {
|
|
25
|
+
"version": "8.20.0",
|
|
26
|
+
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
|
|
27
|
+
"integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
|
|
28
|
+
"dev": true,
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"fast-deep-equal": "^3.1.3",
|
|
32
|
+
"fast-uri": "^3.0.1",
|
|
33
|
+
"json-schema-traverse": "^1.0.0",
|
|
34
|
+
"require-from-string": "^2.0.2"
|
|
35
|
+
},
|
|
36
|
+
"funding": {
|
|
37
|
+
"type": "github",
|
|
38
|
+
"url": "https://github.com/sponsors/epoberezkin"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"node_modules/ajv/node_modules/fast-uri": {
|
|
42
|
+
"version": "3.1.5",
|
|
43
|
+
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz",
|
|
44
|
+
"integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==",
|
|
45
|
+
"dev": true,
|
|
46
|
+
"funding": [
|
|
47
|
+
{
|
|
48
|
+
"type": "github",
|
|
49
|
+
"url": "https://github.com/sponsors/fastify"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "opencollective",
|
|
53
|
+
"url": "https://opencollective.com/fastify"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"license": "BSD-3-Clause"
|
|
57
|
+
},
|
|
58
|
+
"node_modules/entities": {
|
|
59
|
+
"version": "6.0.1",
|
|
60
|
+
"resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
|
|
61
|
+
"integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
|
|
62
|
+
"dev": true,
|
|
63
|
+
"license": "BSD-2-Clause",
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=0.12"
|
|
66
|
+
},
|
|
67
|
+
"funding": {
|
|
68
|
+
"url": "https://github.com/fb55/entities?sponsor=1"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"node_modules/fast-deep-equal": {
|
|
72
|
+
"version": "3.1.3",
|
|
73
|
+
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
|
74
|
+
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
|
75
|
+
"dev": true,
|
|
76
|
+
"license": "MIT"
|
|
77
|
+
},
|
|
78
|
+
"node_modules/json-schema-traverse": {
|
|
79
|
+
"version": "1.0.0",
|
|
80
|
+
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
|
|
81
|
+
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
|
|
82
|
+
"dev": true,
|
|
83
|
+
"license": "MIT"
|
|
84
|
+
},
|
|
85
|
+
"node_modules/parse5": {
|
|
86
|
+
"version": "7.3.0",
|
|
87
|
+
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz",
|
|
88
|
+
"integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==",
|
|
89
|
+
"dev": true,
|
|
90
|
+
"license": "MIT",
|
|
91
|
+
"dependencies": {
|
|
92
|
+
"entities": "^6.0.0"
|
|
93
|
+
},
|
|
94
|
+
"funding": {
|
|
95
|
+
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"node_modules/require-from-string": {
|
|
99
|
+
"version": "2.0.2",
|
|
100
|
+
"resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
|
|
101
|
+
"integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
|
|
102
|
+
"dev": true,
|
|
103
|
+
"license": "MIT",
|
|
104
|
+
"engines": {
|
|
105
|
+
"node": ">=0.10.0"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"node_modules/saxes": {
|
|
109
|
+
"version": "6.0.0",
|
|
110
|
+
"resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",
|
|
111
|
+
"integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
|
|
112
|
+
"dev": true,
|
|
113
|
+
"license": "ISC",
|
|
114
|
+
"dependencies": {
|
|
115
|
+
"xmlchars": "^2.2.0"
|
|
116
|
+
},
|
|
117
|
+
"engines": {
|
|
118
|
+
"node": ">=v12.22.7"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"node_modules/simple-icons": {
|
|
122
|
+
"version": "16.28.0",
|
|
123
|
+
"resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-16.28.0.tgz",
|
|
124
|
+
"integrity": "sha512-sQPR5AtK/ijRjou7zw7mlLp08oB6FH7i0lOy5XJ2zp9mJs/yejgiOn7KvQoe2q4YJIx6VmgUSW5AOefebPt5kg==",
|
|
125
|
+
"dev": true,
|
|
126
|
+
"funding": [
|
|
127
|
+
{
|
|
128
|
+
"type": "opencollective",
|
|
129
|
+
"url": "https://opencollective.com/simple-icons"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "github",
|
|
133
|
+
"url": "https://github.com/sponsors/simple-icons"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"license": "CC0-1.0",
|
|
137
|
+
"engines": {
|
|
138
|
+
"node": ">=0.12.18"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"node_modules/xmlchars": {
|
|
142
|
+
"version": "2.2.0",
|
|
143
|
+
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
|
144
|
+
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
|
|
145
|
+
"dev": true,
|
|
146
|
+
"license": "MIT"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "archify",
|
|
3
|
+
"version": "2.17.0-dev.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "JSON-IR diagram renderers (architecture / workflow / sequence / dataflow / lifecycle).",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"bin": {
|
|
9
|
+
"archify": "./bin/archify.mjs"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"generate:viewer": "node ../scripts/generate-viewer.mjs",
|
|
16
|
+
"check:viewer": "node ../scripts/generate-viewer.mjs --check",
|
|
17
|
+
"generate:brand-marks": "node scripts/generate-brand-marks.mjs",
|
|
18
|
+
"check:brand-marks": "node scripts/generate-brand-marks.mjs --check",
|
|
19
|
+
"generate:validators": "node scripts/generate-validators.mjs",
|
|
20
|
+
"check:validators": "node scripts/generate-validators.mjs --check",
|
|
21
|
+
"check:release-identity": "node ../scripts/check-release-identity.mjs",
|
|
22
|
+
"build:gallery": "node ../scripts/build-gallery.mjs ../docs",
|
|
23
|
+
"build:guide": "node ../scripts/build-guide.mjs ../docs/guide.html",
|
|
24
|
+
"build:start": "node ../scripts/build-start.mjs ../docs/start.html",
|
|
25
|
+
"build:readme-showcase": "node ../scripts/build-readme-showcase.mjs",
|
|
26
|
+
"test:webm": "node test/webm-artifact.smoke.mjs && node --test test/site-language-integration.mjs",
|
|
27
|
+
"test": "npm run check:viewer && npm run check:brand-marks && npm run check:validators && npm run check:release-identity && node test/golden.mjs && node ../scripts/run-tests.mjs",
|
|
28
|
+
"render:examples": "node scripts/render-examples.mjs ../examples"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"ajv": "^8.17.1",
|
|
32
|
+
"parse5": "7.3.0",
|
|
33
|
+
"saxes": "6.0.0",
|
|
34
|
+
"simple-icons": "16.28.0"
|
|
35
|
+
},
|
|
36
|
+
"overrides": {
|
|
37
|
+
"fast-uri": "3.1.5"
|
|
38
|
+
}
|
|
39
|
+
}
|