Skip to content

Commit ad33a57

Browse files
committed
Initial import from codebase-sysmledgraph
Made-with: Cursor
0 parents  commit ad33a57

70 files changed

Lines changed: 7739 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/mcp.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"mcpServers": {
3+
"sysml-v2": {
4+
"command": "node",
5+
"args": ["node_modules/sysml-v2-lsp/dist/server/mcpServer.js"]
6+
},
7+
"gitnexus": {
8+
"command": "npx",
9+
"args": ["-y", "gitnexus@latest", "mcp"]
10+
},
11+
"context7": {
12+
"command": "npx",
13+
"args": ["-y", "@upstash/context7-mcp@latest"]
14+
}
15+
}
16+
}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules/
2+
dist/
3+
*.log
4+
.env
5+
.sysmledgraph/
6+
.sysmledgraph-*/
7+
.sysmledgraph-index-result.txt
8+
graph-export.json
9+
graph-map*.md
10+
analyze-out.txt
11+
.gitnexus
12+
*.tsbuildinfo
13+
coverage/
14+
.cache/

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Optional: use Git Bash for npm scripts on Windows if a dependency needs Unix-style shell
2+
# script-shell=C:\\Program Files\\git\\bin\\bash.exe

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

bin/cli.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env node
2+
/**
3+
* CLI entrypoint: analyze, list, clean.
4+
*/
5+
6+
import { program } from 'commander';
7+
import {
8+
configureStorageRoot,
9+
cmdAnalyze,
10+
cmdList,
11+
cmdClean,
12+
} from '../src/cli/commands.js';
13+
14+
program
15+
.name('sysmledgraph')
16+
.description('Path-only SysML indexer: knowledge graph, MCP server, CLI')
17+
.option('--storage <path>', 'Storage root (default: ~/.sysmledgraph)', process.env.SYSMEDGRAPH_STORAGE_ROOT);
18+
19+
program
20+
.command('analyze <paths...>', { isDefault: true })
21+
.description('Index path(s): discover .sysml, build graph')
22+
.action(async (paths: string[]) => {
23+
const opts = program.opts();
24+
configureStorageRoot(opts.storage);
25+
if (paths.length > 0) {
26+
process.stderr.write(`Indexing ${paths.length} path(s)...\n`);
27+
}
28+
const result = await cmdAnalyze(paths);
29+
if (!result.ok) {
30+
process.stderr.write((result.error ?? 'Unknown error') + '\n');
31+
if (result.filesProcessed !== undefined && result.filesProcessed > 0) {
32+
process.stderr.write(`(Indexed ${result.filesProcessed} file(s) before error.)\n`);
33+
}
34+
process.exit(1);
35+
}
36+
const n = result.filesProcessed ?? 0;
37+
process.stderr.write(`Indexed ${n} file(s).\n`);
38+
});
39+
40+
program
41+
.command('list')
42+
.description('List indexed path(s)')
43+
.action(async () => {
44+
configureStorageRoot(program.opts().storage);
45+
const result = await cmdList();
46+
if (!result.ok) {
47+
process.stderr.write((result.error ?? 'Unknown error') + '\n');
48+
process.exit(1);
49+
}
50+
for (const p of result.paths) {
51+
console.log(p);
52+
}
53+
});
54+
55+
program
56+
.command('clean [path]')
57+
.description('Remove index for path or all')
58+
.action(async (path?: string) => {
59+
configureStorageRoot(program.opts().storage);
60+
const result = await cmdClean(path);
61+
if (!result.ok) {
62+
process.stderr.write((result.error ?? 'Unknown error') + '\n');
63+
process.exit(1);
64+
}
65+
});
66+
67+
program.parseAsync().catch((err: Error) => {
68+
process.stderr.write(String(err) + '\n');
69+
process.exit(1);
70+
});

modelbase-development/config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Modelbase Development – workflow and iteration across software, hardware, mechanism, system deployment.
2+
# Kernel + ScalarValues only.
3+
default_diagram_type: bdd
4+
auto_generate: [bdd, ibd]
5+
deployment_part: ModelbaseDevelopmentDeployment
6+
show_inventree_stock: false
7+
show_clickup_status: false
8+
color_by_status: false
9+
10+
model_dir: models
11+
model_files:
12+
- ../../../libs/omg/SysML-v2-Release/sysml.library/Kernel Libraries/Kernel Semantic Library/Base.kerml
13+
- ../../../libs/omg/SysML-v2-Release/sysml.library/Kernel Libraries/Kernel Data Type Library/ScalarValues.kerml
14+
- requirements-modelbase-development.sysml
15+
- deploy-modelbase-development.sysml
16+
- behaviour-modelbase-development.sysml
17+
- project-modelbase-development.sysml
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
Model-based development behaviour: Plan flows to implement side (develop);
3+
report flows from implement side to modelbase. Only modelbase decides if
4+
iteration is done and updates plan for next iteration. Plan → develop →
5+
deploy → integrate → verify → report → update (decide); repeat = iteration.
6+
*/
7+
package ModelbaseDevelopmentBehaviour {
8+
private import ModelbaseDevelopment::*;
9+
private import ModelbaseDevelopmentRequirements::*;
10+
11+
action def Plan {
12+
doc /* Modelbase: produce or update the plan (to do) from the model. */
13+
out item plan : DevelopmentPlan;
14+
satisfy ReqWorkflowDescribed;
15+
satisfy ReqPlanFromModelbase;
16+
}
17+
18+
action def DoSoftwareDevelopment {
19+
doc /* Implement side (e.g. codebase): execute software development against plan and model. */
20+
in item plan : DevelopmentPlan;
21+
satisfy ReqWorkflowDescribed;
22+
}
23+
24+
action def DoHardwareDevelopment {
25+
doc /* Implement side (e.g. hardware repo): execute hardware development against plan and model. */
26+
in item plan : DevelopmentPlan;
27+
satisfy ReqWorkflowDescribed;
28+
}
29+
30+
action def DoMechanismDevelopment {
31+
doc /* Implement side (e.g. mechanism repo): execute mechanism development against plan and model. */
32+
in item plan : DevelopmentPlan;
33+
satisfy ReqWorkflowDescribed;
34+
}
35+
36+
action def DoSystemDeployment {
37+
doc /* Implement side (e.g. deployment repo): define and execute system deployment (integration, topology). */
38+
in item plan : DevelopmentPlan;
39+
satisfy ReqWorkflowDescribed;
40+
}
41+
42+
action def Integrate {
43+
doc /* Implement side: integrate SW/HW/mechanism outputs into the system. */
44+
satisfy ReqWorkflowDescribed;
45+
}
46+
47+
action def Verify {
48+
doc /* Implement side: verify implementation vs plan and model; feeds implement report. */
49+
satisfy ReqWorkflowDescribed;
50+
}
51+
52+
action def ProduceImplementReport {
53+
doc /* Implement side: produce implement report (alignment, gaps, traceability); deliver to modelbase. Implement side only gives the report; does not decide if iteration is done. */
54+
out item report : ImplementReport;
55+
satisfy ReqWorkflowDescribed;
56+
satisfy ReqReportFromImplementSide;
57+
satisfy ReqTraceability;
58+
}
59+
60+
action def UpdateModelFromGaps {
61+
doc /* Modelbase: receive report; decide whether iteration is done; if done, update plan for next iteration (or close); if not, plan unchanged. Only modelbase decides. */
62+
in item report : ImplementReport;
63+
satisfy ReqIteration;
64+
satisfy ReqWorkflowDescribed;
65+
satisfy ReqPlanFromModelbase;
66+
satisfy ReqDecideByModelbase;
67+
}
68+
69+
action def ModelBasedDevelopmentIteration {
70+
doc /* One iteration: plan → develop → report → update. Only modelbase decides if iteration is done and updates plan for next iteration; implement side only delivers report. Repeat. */
71+
action plan : Plan;
72+
action doSoftware : DoSoftwareDevelopment;
73+
action doHardware : DoHardwareDevelopment;
74+
action doMechanism : DoMechanismDevelopment;
75+
action doDeploy : DoSystemDeployment;
76+
action integrate : Integrate;
77+
action verify : Verify;
78+
action produceImplementReport : ProduceImplementReport;
79+
action updateFromGaps : UpdateModelFromGaps;
80+
flow from plan.plan to doSoftware.plan;
81+
flow from plan.plan to doHardware.plan;
82+
flow from plan.plan to doMechanism.plan;
83+
flow from plan.plan to doDeploy.plan;
84+
flow from produceImplementReport.report to updateFromGaps.report;
85+
then plan;
86+
then doSoftware;
87+
then doHardware;
88+
then doMechanism;
89+
then doDeploy;
90+
then integrate;
91+
then verify;
92+
then produceImplementReport;
93+
then updateFromGaps;
94+
satisfy ReqWorkflowDescribed;
95+
satisfy ReqIteration;
96+
}
97+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
/*
2+
Model-based development structure: modelbase, implement side, and four domains.
3+
Plan and report flow between modelbase and implement side. Per domain the
4+
implement side may be named e.g. codebase (software), hardware repo,
5+
mechanism repo, deployment repo.
6+
*/
7+
package ModelbaseDevelopment {
8+
private import ModelbaseDevelopmentRequirements::*;
9+
10+
item def DevelopmentPlan {
11+
doc /* Plan (to do) generated by modelbase; flows to implement side (e.g. codebase) as implementation guide. */
12+
}
13+
14+
item def ImplementReport {
15+
doc /* Implement report (alignment, gaps, traceability) generated by implement side; flows to modelbase. Implement side only delivers it; only modelbase decides if iteration is done. */
16+
}
17+
18+
part def ModelRequirements {
19+
doc /* Requirements pillar of the SysML model: requirement definitions, satisfy/derive/verify. */
20+
}
21+
22+
part def ModelStructure {
23+
doc /* Structure pillar: blocks, parts, connections, ports; deploy and BDD/IBD. */
24+
}
25+
26+
part def ModelBehaviour {
27+
doc /* Behaviour pillar: actions, activities, state machines; workflow and iteration. */
28+
}
29+
30+
part def PlanToDo {
31+
doc /* Development plan (to do): checkable steps, phases, implementation layout (e.g. CODEBASE_STRUCTURE); generated from the model; flows out as DevelopmentPlan item. */
32+
}
33+
34+
part def Modelbase {
35+
doc /*
36+
Holds the model and the plan; generates the plan (to do); receives implement report.
37+
Only the modelbase decides whether an iteration is done; when done, updates the plan
38+
for the next iteration (or closes). Composed of requirements, structure, behaviour,
39+
and plan artifact.
40+
*/
41+
part modelRequirements : ModelRequirements;
42+
part modelStructure : ModelStructure;
43+
part modelBehaviour : ModelBehaviour;
44+
part planToDo : PlanToDo;
45+
satisfy ReqPlanFromModelbase;
46+
satisfy ReqDecideByModelbase;
47+
}
48+
49+
part def ImplementSide {
50+
doc /*
51+
Implements against plan and model; produces and delivers the implement report
52+
(alignment, gaps, traceability). Only gives the report; does not decide if
53+
iteration is done. Per domain may be named e.g. codebase (software), hardware
54+
repo, mechanism repo, deployment repo.
55+
*/
56+
satisfy ReqReportFromImplementSide;
57+
satisfy ReqTraceability;
58+
}
59+
60+
part def SoftwareDevelopment {
61+
doc /* Software development: design and implementation against the model and plan. */
62+
satisfy ReqFourDomains;
63+
}
64+
65+
part def HardwareDevelopment {
66+
doc /* Hardware development: electronics/PCBA (BOM, netlists, parts) aligned with the model. */
67+
satisfy ReqFourDomains;
68+
}
69+
70+
part def MechanismDevelopment {
71+
doc /* Mechanism development: mechanical/mechatronic design and implementation. */
72+
satisfy ReqFourDomains;
73+
}
74+
75+
part def SystemDeployment {
76+
doc /* System deployment: integration, topology, operational configuration. */
77+
satisfy ReqFourDomains;
78+
}
79+
80+
part def ModelbaseDevelopmentDeployment {
81+
doc /* Composite: modelbase + implement side + four development domains. Workflow and iteration in behaviour. */
82+
part modelbase : Modelbase;
83+
part implementSide : ImplementSide;
84+
part softwareDevelopment : SoftwareDevelopment;
85+
part hardwareDevelopment : HardwareDevelopment;
86+
part mechanismDevelopment : MechanismDevelopment;
87+
part systemDeployment : SystemDeployment;
88+
satisfy ReqFourDomains;
89+
}
90+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
Project-level grouping for modelbase-development. Imports all project packages.
3+
Convention: project-<name>.sysml contains package Project<NamePascalCase> that
4+
imports requirements, deploy, behaviour.
5+
*/
6+
package ProjectModelbaseDevelopment {
7+
private import ModelbaseDevelopmentRequirements::*;
8+
private import ModelbaseDevelopment::*;
9+
private import ModelbaseDevelopmentBehaviour::*;
10+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
Model-based development workflow: four domains, plan from modelbase, report from
3+
implement side (per-domain names: e.g. codebase for software, hardware repo,
4+
mechanism repo, deployment repo). Iteration, traceability.
5+
*/
6+
package ModelbaseDevelopmentRequirements {
7+
8+
requirement def ReqFourDomains {
9+
doc /*
10+
The model-based development workflow shall include the four development domains:
11+
software development, hardware development, mechanism development, and system deployment.
12+
*/
13+
}
14+
15+
requirement def ReqWorkflowDescribed {
16+
doc /*
17+
The workflow shall be described in the model (activities, actions, and their order
18+
or iteration) so that plan → implement → report → update is explicit.
19+
*/
20+
}
21+
22+
requirement def ReqIteration {
23+
doc /*
24+
The process shall support iteration: feedback from the implement report (alignment, gaps)
25+
shall be usable to update the model or plan and to re-run development steps.
26+
*/
27+
}
28+
29+
requirement def ReqPlanFromModelbase {
30+
doc /*
31+
The plan (to do: development plan, checkable steps, what to build) shall be
32+
generated by the modelbase and used as the implementation guide by the
33+
implement side (e.g. codebase, hardware repo, mechanism repo, deployment repo).
34+
*/
35+
}
36+
37+
requirement def ReqReportFromImplementSide {
38+
doc /*
39+
The implement report (alignment vs plan/model, gaps, traceability) shall be
40+
generated by the implement side and delivered to the modelbase for each
41+
iteration. The implement side only gives the report; it does not decide
42+
whether the iteration is done. Per domain the implement side may be named
43+
e.g. codebase (software), hardware repo, mechanism repo, deployment repo.
44+
*/
45+
}
46+
47+
requirement def ReqDecideByModelbase {
48+
doc /*
49+
Only the modelbase shall decide whether an iteration is done (after
50+
reviewing the implement report). When the modelbase decides done, it
51+
updates the plan for the next iteration (or closes). When not done,
52+
the implement side continues with the same or updated plan.
53+
*/
54+
}
55+
56+
requirement def ReqTraceability {
57+
doc /*
58+
The implement side shall produce traceability from plan steps to implementation
59+
(e.g. IMPLEMENTATION_PLAN.md: step, plan, implementation paths) as part of the
60+
implement report. Per domain: codebase, hardware repo, etc.
61+
*/
62+
}
63+
}

0 commit comments

Comments
 (0)