@jstn-sdk/ma 0.1.4 → 0.1.5

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.
Files changed (112) hide show
  1. package/.codex/config.toml +2 -0
  2. package/.codex/hooks.json +1 -1
  3. package/.codex/prompts/enforcement.md +3 -3
  4. package/.codex/prompts/onboarding.md +14 -29
  5. package/README.md +129 -472
  6. package/bin/ma.js +103 -54
  7. package/docs/README.md +1 -2
  8. package/docs/getting-started.md +37 -402
  9. package/docs/mcp-setup.md +134 -3
  10. package/docs/onboarding.md +11 -41
  11. package/docs/qa/release-readiness-0.1.5.md +77 -0
  12. package/docs/release-spec.md +103 -81
  13. package/docs/skills-publishing.md +54 -187
  14. package/docs/skills.md +141 -78
  15. package/mcp/collections.json +1 -1
  16. package/mcp/fallback.json +1 -1
  17. package/mcp/servers.json +1 -1
  18. package/package.json +14 -17
  19. package/plugins/meta-architect/.app.json +1 -1
  20. package/plugins/meta-architect/.mcp.json +1 -1
  21. package/plugins/meta-architect/README.md +10 -23
  22. package/plugins/meta-architect/skills/meta-architect/SKILL.md +23 -17
  23. package/plugins/meta-architect/skills/meta-architect-arch/SKILL.md +24 -0
  24. package/plugins/meta-architect/skills/meta-architect-build/SKILL.md +25 -0
  25. package/plugins/meta-architect/skills/meta-architect-flow/SKILL.md +23 -0
  26. package/plugins/meta-architect/skills/meta-architect-sage/SKILL.md +23 -0
  27. package/plugins/meta-architect/skills/meta-architect-vet/SKILL.md +23 -0
  28. package/plugins/meta-architect/skills/meta-architect-vibe/SKILL.md +24 -0
  29. package/prompts/architect.md +216 -0
  30. package/prompts/builder.md +10 -0
  31. package/prompts/flow.md +9 -0
  32. package/prompts/release-manager.md +10 -0
  33. package/prompts/sage.md +10 -0
  34. package/prompts/security-reviewer.md +10 -0
  35. package/prompts/verifier.md +10 -0
  36. package/prompts/vibe.md +10 -0
  37. package/scripts/doctor.js +0 -8
  38. package/scripts/skills-install.js +36 -4
  39. package/scripts/skills-manifest.js +1 -1
  40. package/scripts/skills-validate.js +40 -78
  41. package/skills/index.json +22 -22
  42. package/skills/meta-architect/SKILL.md +23 -17
  43. package/skills/meta-architect/agents/openai.yaml +3 -3
  44. package/skills/meta-architect/references/core-release-rules.md +2 -2
  45. package/skills/meta-architect-arch/SKILL.md +24 -0
  46. package/skills/meta-architect-arch/agents/openai.yaml +4 -0
  47. package/skills/meta-architect-build/SKILL.md +25 -0
  48. package/skills/meta-architect-build/agents/openai.yaml +4 -0
  49. package/skills/meta-architect-flow/SKILL.md +23 -0
  50. package/skills/meta-architect-flow/agents/openai.yaml +4 -0
  51. package/skills/meta-architect-sage/SKILL.md +23 -0
  52. package/skills/meta-architect-sage/agents/openai.yaml +4 -0
  53. package/skills/meta-architect-vet/SKILL.md +23 -0
  54. package/skills/meta-architect-vet/agents/openai.yaml +4 -0
  55. package/skills/meta-architect-vibe/SKILL.md +24 -0
  56. package/skills/meta-architect-vibe/agents/openai.yaml +4 -0
  57. package/sprint/00-idea.md +1 -1
  58. package/sprint/01-architecture.md +1 -1
  59. package/sprint/02-oss-evidence.md +1 -1
  60. package/sprint/03-logic.md +1 -1
  61. package/sprint/04-security.md +2 -2
  62. package/sprint/05-dx-ux.md +1 -1
  63. package/src/decision-log.js +4 -4
  64. package/src/doctor.js +30 -0
  65. package/src/launcher.js +17 -21
  66. package/src/mcp-live-client.js +1 -1
  67. package/src/paths.js +32 -8
  68. package/src/release-state.js +3 -3
  69. package/src/setup.js +375 -0
  70. package/src/skills.js +166 -309
  71. package/templates/AGENTS.md +6 -6
  72. package/templates/model-instructions/core.md +1 -1
  73. package/.agents/plugins/marketplace.json +0 -20
  74. package/docs/assets/meta-architect-logo.png +0 -0
  75. package/docs/assets/meta-architect-logo.svg +0 -8
  76. package/docs/installed-sdk.md +0 -60
  77. package/docs/qa/release-readiness-0.1.4.md +0 -79
  78. package/plugins/meta-architect/.codex-plugin/plugin.json +0 -23
  79. package/plugins/meta-architect/skills/arch/SKILL.md +0 -27
  80. package/plugins/meta-architect/skills/arch/agents/openai.yaml +0 -4
  81. package/plugins/meta-architect/skills/build/SKILL.md +0 -24
  82. package/plugins/meta-architect/skills/build/agents/openai.yaml +0 -4
  83. package/plugins/meta-architect/skills/flow/SKILL.md +0 -24
  84. package/plugins/meta-architect/skills/flow/agents/openai.yaml +0 -4
  85. package/plugins/meta-architect/skills/meta-architect/agents/openai.yaml +0 -4
  86. package/plugins/meta-architect/skills/meta-architect/references/core-release-rules.md +0 -13
  87. package/plugins/meta-architect/skills/sage/SKILL.md +0 -24
  88. package/plugins/meta-architect/skills/sage/agents/openai.yaml +0 -4
  89. package/plugins/meta-architect/skills/vet/SKILL.md +0 -25
  90. package/plugins/meta-architect/skills/vet/agents/openai.yaml +0 -4
  91. package/plugins/meta-architect/skills/vibe/SKILL.md +0 -24
  92. package/plugins/meta-architect/skills/vibe/agents/openai.yaml +0 -4
  93. package/scripts/plugin-sync.js +0 -92
  94. package/scripts/postinstall.js +0 -23
  95. package/scripts/release-metadata.js +0 -94
  96. package/scripts/release-sync.js +0 -359
  97. package/scripts/release-verify.js +0 -153
  98. package/scripts/setup-npmrc.js +0 -39
  99. package/skills/arch/SKILL.md +0 -27
  100. package/skills/arch/agents/openai.yaml +0 -4
  101. package/skills/build/SKILL.md +0 -24
  102. package/skills/build/agents/openai.yaml +0 -4
  103. package/skills/flow/SKILL.md +0 -24
  104. package/skills/flow/agents/openai.yaml +0 -4
  105. package/skills/sage/SKILL.md +0 -24
  106. package/skills/sage/agents/openai.yaml +0 -4
  107. package/skills/vet/SKILL.md +0 -25
  108. package/skills/vet/agents/openai.yaml +0 -4
  109. package/skills/vibe/SKILL.md +0 -24
  110. package/skills/vibe/agents/openai.yaml +0 -4
  111. package/src/runtime-artifacts.js +0 -363
  112. package/src/skill-installer.js +0 -198
@@ -1,30 +1,36 @@
1
1
  ---
2
2
  name: meta-architect
3
- description: "Use when the user wants the full Meta-Architect workflow inside Codex: architecture-first planning, evidence-backed OSS selection, logic review, security review, DX/UX review, and build readiness without leaving the Codex session."
3
+ description: "Use when Codex needs the full Meta-Architect runtime layer in this repo: architecture, evidence, logic, security, experience, and build workflows operating through skill tags inside Codex. Trigger for requests about Meta-Architect orchestration, build gating, GitMCP-backed evidence, branch/worktree planning, or releasing through `development` and `prod`."
4
4
  ---
5
5
 
6
6
  # Meta-Architect
7
7
 
8
- ## Overview
8
+ Meta-Architect is the umbrella runtime skill for the Codex-hosted workflow in this repository.
9
9
 
10
- Run the full Meta-Architect workflow inside Codex. Use this skill when the user wants the gated design-and-review sequence rather than a single specialist lane.
10
+ ## Canonical runtime usage
11
11
 
12
- ## Workflow
12
+ 1. Install `@openai/codex` and `meta-architect`
13
+ 2. Launch `ma --madmax --high`
14
+ 3. Operate through `$arch`, `$sage`, `$flow`, `$vet`, `$vibe`, `$build`
13
15
 
14
- 1. Start with `$arch` and turn the user's goal into a concrete architecture brief.
15
- 2. Continue with `$sage` to validate core stack choices against official docs or approved repo-backed sources.
16
- 3. Run `$flow` to map states, transitions, invariants, and blockers.
17
- 4. Run `$vet` to review trust boundaries, auth, data handling, and abuse paths.
18
- 5. Run `$vibe` to review developer and user experience quality.
19
- 6. Finish with `$build` to decide whether implementation is ready, what remains blocked, and what the exact next execution step should be.
16
+ ## Secondary helper usage
20
17
 
21
- ## Rules
18
+ Use helper commands only for scripted validation, diagnostics, or repo-local maintenance:
19
+ - `ma status`
20
+ - `ma idea "..."`
21
+ - `ma run ...`
22
+ - `ma merge`
23
+ - `ma release`
24
+ - `ma doctor`
25
+ - `ma setup`
22
26
 
23
- - Stay inside Codex unless the user explicitly asks for repo-local helper commands.
24
- - Keep the workflow architecture-first. Do not jump into code before the architecture and review lanes are grounded.
25
- - Prefer official docs, upstream repos, and repo-configured GitMCP sources when validating tooling choices.
26
- - End each lane with a clear result shape: decision, evidence, blockers, and exact next trigger.
27
+ ## Expected outputs
27
28
 
28
- ## References
29
+ - appended decisions in `.omx/decisions.json`
30
+ - gate updates in `.omx/release.json`
31
+ - evidence updates under `.omx/evidence/`
32
+ - explicit blockers and next allowed triggers when work is blocked
29
33
 
30
- - For release gates and branch policy, read `references/core-release-rules.md`.
34
+ ## Contract rule
35
+
36
+ Do not treat helper commands as the primary story. The primary story is always the Codex session launched with `ma --madmax --high`.
@@ -1,4 +1,4 @@
1
1
  interface:
2
- display_name: "$meta-architect"
3
- short_description: "Full Meta-Architect skill workflow"
4
- default_prompt: "Use $meta-architect to run the full Meta-Architect workflow inside Codex, then route through $arch, $sage, $flow, $vet, $vibe, and $build as needed."
2
+ display_name: "Meta-Architect"
3
+ short_description: "Codex-native runtime orchestration and gated build workflows"
4
+ default_prompt: "Use $meta-architect inside Codex to run the gated Meta-Architect runtime workflow in this repo."
@@ -1,6 +1,6 @@
1
1
  # Core Release Rules
2
2
 
3
- - Required status fields live in `.ma/decisions.json` and `.ma/release.json`.
3
+ - Required status fields live in `.omx/decisions.json` and `.omx/release.json`.
4
4
  - `$build` is blocked unless:
5
5
  - `idea_status = CLEAR`
6
6
  - `architecture_status = APPROVED`
@@ -10,4 +10,4 @@
10
10
  - `experience_status = GREEN` or `WAIVED`
11
11
  - Feature work merges into `development`, never directly into `prod`.
12
12
  - Release promotion is allowed only from `development` or approved `release/*`.
13
- - Use the helper command path only when repo-local state automation is explicitly needed; otherwise stay inside Codex and carry the gate decisions in the session.
13
+ - Use `ma status`, `ma merge`, and `ma release` instead of manual state edits.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: meta-architect-arch
3
+ description: "Use when Codex needs to run or explain the Meta-Architect `$arch` lane for architecture, stack rationale, subsystem layout, and blueprint decisions. Trigger for requests about architecture design inside a Meta-Architect-managed repo or for producing the first design artifact after the idea is captured."
4
+ ---
5
+
6
+ # Meta-Architect Arch
7
+
8
+ Use `$arch` inside the Codex-hosted Meta-Architect runtime to produce the first architecture blueprint.
9
+
10
+ ## Canonical trigger
11
+
12
+ - `$arch`
13
+
14
+ ## Secondary helper path
15
+
16
+ ```bash
17
+ ma idea "Build a fintech operations dashboard"
18
+ ma run '$arch'
19
+ ```
20
+
21
+ ## Expected result
22
+
23
+ - architecture decision appended to `.omx/decisions.json`
24
+ - `architecture_status = APPROVED` in `.omx/release.json`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "MA Architect"
3
+ short_description: "Architecture and stack design for MA flows"
4
+ default_prompt: "Use $meta-architect-arch to produce architecture and stack rationale for a Meta-Architect-managed project."
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: meta-architect-build
3
+ description: "Use when Codex needs to run or inspect the Meta-Architect `$build` lane for gate evaluation, branch suggestions, worktree planning, and build readiness. Trigger for requests about whether the build is unlocked, which gate is blocking, or what feature branches and worktree commands should be used next."
4
+ ---
5
+
6
+ # Meta-Architect Build
7
+
8
+ Use `$build` inside the Codex-hosted Meta-Architect runtime to evaluate gate readiness and prepare bounded implementation work.
9
+
10
+ ## Canonical trigger
11
+
12
+ - `$build`
13
+
14
+ ## Secondary helper path
15
+
16
+ ```bash
17
+ ma status
18
+ ma run '$build'
19
+ ```
20
+
21
+ ## Expected result
22
+
23
+ - blocked builds explain the exact gate failures
24
+ - ready builds set `build_status = READY`
25
+ - suggested `feature/*` branches and optional worktree commands are printed
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "MA Build"
3
+ short_description: "Gated build planning and branch/worktree prep"
4
+ default_prompt: "Use $meta-architect-build to evaluate gates, propose feature branches, and prepare build execution."
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: meta-architect-flow
3
+ description: "Use when Codex needs to run or inspect the Meta-Architect `$flow` lane for business logic, state transitions, and blockers. Trigger for requests about logic maps, dead ends, state validation, or whether the workflow is ready to proceed to security review."
4
+ ---
5
+
6
+ # Meta-Architect Flow
7
+
8
+ Use `$flow` inside the Codex-hosted Meta-Architect runtime to review logic, state transitions, and blockers.
9
+
10
+ ## Canonical trigger
11
+
12
+ - `$flow`
13
+
14
+ ## Secondary helper path
15
+
16
+ ```bash
17
+ ma run '$flow'
18
+ ```
19
+
20
+ ## Expected result
21
+
22
+ - logic review appended to `.omx/decisions.json`
23
+ - `logic_status` becomes `GREEN` or `RED`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "MA Flow"
3
+ short_description: "Business logic and state validation for MA"
4
+ default_prompt: "Use $meta-architect-flow to map business logic, states, transitions, and blockers in a Meta-Architect workflow."
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: meta-architect-sage
3
+ description: "Use when Codex needs to run or inspect the Meta-Architect `$sage` lane for OSS evidence binding through GitMCP and MCP. Trigger for requests about verifying repos, collecting evidence from configured GitMCP endpoints, or checking whether a recommendation is VERIFIED, PARTIAL, or MISSING."
4
+ ---
5
+
6
+ # Meta-Architect Sage
7
+
8
+ Use `$sage` inside the Codex-hosted Meta-Architect runtime to bind architecture choices to approved GitMCP evidence.
9
+
10
+ ## Canonical trigger
11
+
12
+ - `$sage`
13
+
14
+ ## Secondary helper path
15
+
16
+ ```bash
17
+ ma run '$sage'
18
+ ```
19
+
20
+ ## Expected result
21
+
22
+ - `.omx/evidence/sources.json` records validated endpoints and live-probe metadata
23
+ - `evidence_status` moves to `VERIFIED`, `PARTIAL`, or `MISSING`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "MA Sage"
3
+ short_description: "GitMCP-backed OSS evidence selection"
4
+ default_prompt: "Use $meta-architect-sage to bind major technical choices to approved GitMCP-backed OSS sources."
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: meta-architect-vet
3
+ description: "Use when Codex needs to run or inspect the Meta-Architect `$vet` lane for security review, risk logging, and CVE-style findings. Trigger for requests about security posture, safer alternatives, audit evidence, or whether the build should stay blocked on security grounds."
4
+ ---
5
+
6
+ # Meta-Architect Vet
7
+
8
+ Use `$vet` inside the Codex-hosted Meta-Architect runtime to review security posture and release-sensitive findings.
9
+
10
+ ## Canonical trigger
11
+
12
+ - `$vet`
13
+
14
+ ## Secondary helper path
15
+
16
+ ```bash
17
+ ma run '$vet'
18
+ ```
19
+
20
+ ## Expected result
21
+
22
+ - `.omx/evidence/audits.json` and `.omx/evidence/cves.json` are updated
23
+ - `security_status` becomes `GREEN` or `RED`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "MA Vet"
3
+ short_description: "Security, CVE, and risk review for MA"
4
+ default_prompt: "Use $meta-architect-vet to review security risks, CVEs, and safer alternatives in a Meta-Architect project."
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: meta-architect-vibe
3
+ description: "Use when Codex needs to run or inspect the Meta-Architect `$vibe` lane for developer-experience and user-experience review before build execution. Trigger for requests about DX friction, UX risks, operator flow quality, or whether the experience gate should be GREEN or WAIVED."
4
+ ---
5
+
6
+ # Meta-Architect Vibe
7
+
8
+ Use `$vibe` inside the Codex-hosted Meta-Architect runtime to review developer and user experience before build planning.
9
+
10
+ ## Canonical trigger
11
+
12
+ - `$vibe`
13
+
14
+ ## Secondary helper path
15
+
16
+ ```bash
17
+ ma run '$vibe'
18
+ ma run '$vibe' --waive --reason "Accepted for this release line"
19
+ ```
20
+
21
+ ## Expected result
22
+
23
+ - `.omx/evidence/outcomes.json` is updated
24
+ - `experience_status` becomes `GREEN`, `RED`, or `WAIVED`
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "MA Vibe"
3
+ short_description: "DX and UX review before Meta-Architect build"
4
+ default_prompt: "Use $meta-architect-vibe to review developer and user experience risks before a Meta-Architect build is unlocked."
package/sprint/00-idea.md CHANGED
@@ -12,7 +12,7 @@ Capture a project idea, clarify scope and constraints, and move the repository f
12
12
 
13
13
  ## Expected outputs
14
14
 
15
- - idea decision entry in `.ma/decisions.json`
15
+ - idea decision entry in `.omx/decisions.json`
16
16
  - `idea_status = CLEAR` when the brief is good enough to proceed
17
17
 
18
18
  ## Exit criteria
@@ -11,7 +11,7 @@ Produce a structured first-pass architecture blueprint, stack rationale, and dow
11
11
 
12
12
  ## Expected outputs
13
13
 
14
- - architecture decision in `.ma/decisions.json`
14
+ - architecture decision in `.omx/decisions.json`
15
15
  - `architecture_status = APPROVED`
16
16
 
17
17
  ## Exit criteria
@@ -11,7 +11,7 @@ Bind major architecture choices to approved GitMCP-backed evidence.
11
11
 
12
12
  ## Expected outputs
13
13
 
14
- - `.ma/evidence/sources.json`
14
+ - `.omx/evidence/sources.json`
15
15
  - `evidence_status = VERIFIED | PARTIAL | MISSING`
16
16
 
17
17
  ## Exit criteria
@@ -11,7 +11,7 @@ Record a structured first-pass logic/state review and block progress if prerequi
11
11
 
12
12
  ## Expected outputs
13
13
 
14
- - logic review entry in `.ma/decisions.json`
14
+ - logic review entry in `.omx/decisions.json`
15
15
  - `logic_status = GREEN | RED`
16
16
 
17
17
  ## Exit criteria
@@ -10,8 +10,8 @@ Record a baseline security pass and keep the workflow blocked if prerequisites a
10
10
 
11
11
  ## Expected outputs
12
12
 
13
- - `.ma/evidence/audits.json`
14
- - `.ma/evidence/cves.json`
13
+ - `.omx/evidence/audits.json`
14
+ - `.omx/evidence/cves.json`
15
15
  - `security_status = GREEN | RED`
16
16
 
17
17
  ## Exit criteria
@@ -10,7 +10,7 @@ Record a baseline developer and user experience pass before build unlock.
10
10
 
11
11
  ## Expected outputs
12
12
 
13
- - `.ma/evidence/outcomes.json`
13
+ - `.omx/evidence/outcomes.json`
14
14
  - `experience_status = GREEN | RED | WAIVED`
15
15
 
16
16
  ## Exit criteria
@@ -1,5 +1,5 @@
1
1
  import { readJson, writeJson } from "./fs-utils.js";
2
- import { getRuntimeReadPath, getRuntimeWritePath } from "./paths.js";
2
+ import { getDecisionsPath } from "./paths.js";
3
3
 
4
4
  function validateDecisionShape(entry) {
5
5
  const required = ["decision", "status", "evidence", "blockers", "next_allowed_triggers"];
@@ -11,7 +11,7 @@ function validateDecisionShape(entry) {
11
11
  }
12
12
 
13
13
  export async function loadDecisionLog() {
14
- const parsed = await readJson(getRuntimeReadPath("decisions.json"));
14
+ const parsed = await readJson(getDecisionsPath());
15
15
 
16
16
  if (!parsed || typeof parsed !== "object" || !Array.isArray(parsed.decisions)) {
17
17
  throw new Error("Decision log must be an object with a decisions array");
@@ -28,7 +28,7 @@ export async function appendDecision(entry) {
28
28
  timestamp: new Date().toISOString(),
29
29
  });
30
30
 
31
- await writeJson(getRuntimeWritePath("decisions.json"), log);
31
+ await writeJson(getDecisionsPath(), log);
32
32
  }
33
33
 
34
34
  export async function updateDecisionStatuses(statusUpdates) {
@@ -36,5 +36,5 @@ export async function updateDecisionStatuses(statusUpdates) {
36
36
  for (const [field, value] of Object.entries(statusUpdates)) {
37
37
  log[field] = value;
38
38
  }
39
- await writeJson(getRuntimeWritePath("decisions.json"), log);
39
+ await writeJson(getDecisionsPath(), log);
40
40
  }
package/src/doctor.js ADDED
@@ -0,0 +1,30 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { getRepoRoot } from "./paths.js";
4
+
5
+ const checks = [
6
+ "AGENTS.md",
7
+ ".codex/config.toml",
8
+ ".codex/hooks.json",
9
+ ".codex/agents/architect.toml",
10
+ ".codex/prompts/enforcement.md",
11
+ ".omx/decisions.json",
12
+ ".omx/release.json",
13
+ "mcp/servers.json",
14
+ "templates/AGENTS.md",
15
+ ];
16
+
17
+ export function runDoctor() {
18
+ const repoRoot = getRepoRoot();
19
+ let failures = 0;
20
+
21
+ for (const relativePath of checks) {
22
+ const ok = fs.existsSync(path.join(repoRoot, relativePath));
23
+ console.log(`${ok ? "[OK]" : "[MISSING]"} ${relativePath}`);
24
+ if (!ok) {
25
+ failures += 1;
26
+ }
27
+ }
28
+
29
+ return failures === 0 ? 0 : 1;
30
+ }
package/src/launcher.js CHANGED
@@ -1,56 +1,52 @@
1
1
  import { spawnSync } from "node:child_process";
2
2
  import path from "node:path";
3
3
 
4
- const nativeCommands = new Set([
4
+ const maintenanceCommands = new Set([
5
5
  "setup",
6
6
  "init",
7
+ "doctor",
7
8
  "idea",
8
9
  "skills",
9
- "sdk-path",
10
10
  "status",
11
+ "run",
11
12
  "merge",
12
13
  "release",
13
- "run",
14
14
  ]);
15
15
 
16
16
  export function shouldDelegateToCodex(args) {
17
17
  if (args.length === 0) {
18
- return true;
18
+ return false;
19
19
  }
20
20
 
21
- return !nativeCommands.has(args[0]);
21
+ const first = args[0];
22
+ return first.startsWith("-") || !maintenanceCommands.has(first);
22
23
  }
23
24
 
24
- function normalizeCodexArgs(args) {
25
+ export function normalizeCodexArgs(args) {
25
26
  return args.filter((arg) => arg !== "--madmax" && arg !== "--high");
26
27
  }
27
28
 
28
29
  function resolveCodexCommand() {
29
- if (process.env.MA_CODEX_BIN) {
30
- return process.env.MA_CODEX_BIN;
31
- }
32
-
33
- return "codex";
30
+ return process.env.MA_CODEX_BIN ?? "codex";
34
31
  }
35
32
 
36
33
  export function runCodex(args) {
37
34
  const codexCommand = resolveCodexCommand();
38
35
  const codexArgs = normalizeCodexArgs(args);
39
- const commandArgs =
40
- path.extname(codexCommand) === ".js" || path.extname(codexCommand) === ".mjs"
41
- ? [codexCommand, ...codexArgs]
42
- : codexArgs;
43
- const command = commandArgs[0] === codexCommand ? process.execPath : codexCommand;
44
- const finalArgs = command === process.execPath ? commandArgs : codexArgs;
45
- const result = spawnSync(command, finalArgs, { stdio: "inherit" });
36
+ const useNode = path.extname(codexCommand) === ".js" || path.extname(codexCommand) === ".mjs";
37
+ const command = useNode ? process.execPath : codexCommand;
38
+ const finalArgs = useNode ? [codexCommand, ...codexArgs] : codexArgs;
39
+ const result = spawnSync(command, finalArgs, {
40
+ stdio: "inherit",
41
+ });
46
42
 
47
43
  if (result.error) {
48
44
  if (result.error.code === "ENOENT") {
49
- throw new Error("Codex not found. Install it with: npm install -g @openai/codex");
45
+ throw new Error("Codex CLI not found. Install it with: npm i -g @openai/codex");
50
46
  }
51
47
 
52
- throw new Error(`Failed to start Codex: ${result.error.message}`);
48
+ throw new Error(`Failed to start Codex CLI: ${result.error.message}`);
53
49
  }
54
50
 
55
- return typeof result.status === "number" ? result.status : 1;
51
+ return result.status ?? 1;
56
52
  }
@@ -38,7 +38,7 @@ export class McpSseClient {
38
38
  capabilities: {},
39
39
  clientInfo: {
40
40
  name: "meta-architect",
41
- version: "0.1.4",
41
+ version: "1.0.0",
42
42
  },
43
43
  });
44
44
 
package/src/paths.js CHANGED
@@ -5,22 +5,46 @@ const __filename = fileURLToPath(import.meta.url);
5
5
  const __dirname = path.dirname(__filename);
6
6
 
7
7
  export const packageRoot = path.resolve(__dirname, "..");
8
+ export function getPackageRoot() {
9
+ return packageRoot;
10
+ }
11
+
8
12
  export function getRepoRoot() {
9
- return process.env.MA_ROOT ? path.resolve(process.env.MA_ROOT) : process.cwd();
13
+ return path.resolve(process.env.MA_ROOT ?? process.cwd());
14
+ }
15
+
16
+ export function resolveRepoPath(...parts) {
17
+ return path.join(getRepoRoot(), ...parts);
10
18
  }
11
19
 
12
- export function getRuntimeRoot() {
13
- return path.join(getRepoRoot(), ".ma");
20
+ export function getOmxRoot() {
21
+ return resolveRepoPath(".omx");
14
22
  }
15
23
 
16
- export function getRuntimeWritePath(...parts) {
17
- return path.join(getRuntimeRoot(), ...parts);
24
+ export function getReleaseStatePath() {
25
+ return path.join(getOmxRoot(), "release.json");
18
26
  }
19
27
 
20
- export function getRuntimeReadPath(...parts) {
21
- return path.join(getRuntimeRoot(), ...parts);
28
+ export function getDecisionsPath() {
29
+ return path.join(getOmxRoot(), "decisions.json");
22
30
  }
23
31
 
24
32
  export function getMcpServersPath() {
25
- return path.join(getRepoRoot(), "mcp", "servers.json");
33
+ return resolveRepoPath("mcp", "servers.json");
34
+ }
35
+
36
+ export function getSourcesPath() {
37
+ return path.join(getOmxRoot(), "evidence", "sources.json");
38
+ }
39
+
40
+ export function getAuditsPath() {
41
+ return path.join(getOmxRoot(), "evidence", "audits.json");
42
+ }
43
+
44
+ export function getOutcomesPath() {
45
+ return path.join(getOmxRoot(), "evidence", "outcomes.json");
46
+ }
47
+
48
+ export function getCvesPath() {
49
+ return path.join(getOmxRoot(), "evidence", "cves.json");
26
50
  }
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs/promises";
2
2
  import { writeJson } from "./fs-utils.js";
3
- import { getRuntimeReadPath, getRuntimeWritePath } from "./paths.js";
3
+ import { getReleaseStatePath } from "./paths.js";
4
4
 
5
5
  const allowedStatuses = {
6
6
  idea_status: ["DRAFT", "CLEAR", "BLOCKED"],
@@ -43,7 +43,7 @@ export function validateReleaseState(state) {
43
43
  }
44
44
 
45
45
  export async function loadReleaseState() {
46
- const raw = await fs.readFile(getRuntimeReadPath("release.json"), "utf8");
46
+ const raw = await fs.readFile(getReleaseStatePath(), "utf8");
47
47
  const parsed = JSON.parse(raw);
48
48
  return validateReleaseState(parsed);
49
49
  }
@@ -54,6 +54,6 @@ export async function saveReleaseState(state) {
54
54
  ...state,
55
55
  updatedAt: new Date().toISOString(),
56
56
  };
57
- await writeJson(getRuntimeWritePath("release.json"), next);
57
+ await writeJson(getReleaseStatePath(), next);
58
58
  return next;
59
59
  }