naive-framework 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -1
- package/docs/decisions/decisions.json +27 -0
- package/docs/reference/ROUTES.md +36 -37
- package/governance/layer.json +2 -1
- package/governance/venture-template/roles/venture-roles.json +62 -0
- package/interface/acting.mjs +83 -0
- package/interface/adapters/claude-code.json +16 -0
- package/interface/adapters/codex.json +14 -0
- package/interface/adapters/cursor.json +16 -0
- package/interface/adapters.mjs +182 -0
- package/interface/api/server.mjs +4 -2
- package/interface/boundaries.mjs +218 -0
- package/interface/brand.mjs +214 -0
- package/interface/cli/freshness.mjs +59 -0
- package/interface/cli/guard.mjs +6 -0
- package/interface/cli/mentura.mjs +78 -8
- package/interface/cli/naive.mjs +33 -8
- package/interface/context.mjs +524 -0
- package/interface/demo/board.mjs +1 -1
- package/interface/dev/setup.mjs +84 -0
- package/interface/gate-hooks.mjs +36 -0
- package/interface/harness/evals.mjs +3 -3
- package/interface/harness/run.mjs +4 -4
- package/interface/instrumentation.mjs +86 -0
- package/interface/kit-boundary.mjs +73 -0
- package/interface/layer.json +8 -2
- package/interface/mcp/server.mjs +47 -7
- package/interface/package-routes.mjs +196 -0
- package/interface/provenance.mjs +24 -1
- package/interface/reads.mjs +173 -0
- package/interface/release-card.mjs +42 -0
- package/interface/router.mjs +101 -28
- package/interface/skills/naive-setup/SKILL.md +71 -0
- package/interface/skills/naive-setup/artifact.html +83 -0
- package/interface/vitals.mjs +115 -0
- package/interface/writes.mjs +190 -0
- package/knowledge/freshness.json +85 -0
- package/knowledge/layer.json +11 -3
- package/knowledge/templates/glossary.md +23 -0
- package/operations/layer.json +10 -3
- package/operations/templates/marketing-brand.md +46 -0
- package/operations/templates/public-assets.md +39 -0
- package/package.json +3 -1
- package/packages/catalog.json +8 -0
- package/packages/customers/package.json +21 -1
- package/packages/deals/package.json +27 -0
- package/packages/decisions/package.json +12 -1
- package/packages/finance/frames/fund-without-ceding-control.frame.json +177 -0
- package/packages/foundation/package.json +8 -1
- package/packages/fund/package.json +48 -0
- package/packages/marketing/package.json +10 -4
- package/packages/money/package.json +24 -3
- package/packages/validation/package.json +13 -0
- package/platform/README.md +6 -0
- package/platform/adapter.json +15 -0
- package/platform/integrations/remote-image.mjs +79 -0
- package/platform/integrations/rho.mjs +7 -6
- package/platform/kits/README.md +8 -1
- package/platform/kits/agent-upgrade/kit.json +15 -0
- package/platform/kits/agent-upgrade/run.mjs +82 -0
- package/platform/kits/agent-upgrade/stand-in-agent.mjs +32 -0
- package/platform/kits/validation-kickoff/kit.json +29 -0
- package/platform/webhooks/server.mjs +70 -0
- package/purpose/frameworks/idea-map/ideamap.mjs +4 -2
- package/schema/README.md +1 -0
- package/schema/access.mjs +57 -0
- package/schema/adapter.schema.json +33 -0
- package/schema/assets.mjs +212 -0
- package/schema/brand.mjs +373 -0
- package/schema/build-release.mjs +61 -0
- package/schema/caching.mjs +505 -0
- package/schema/check-assets.mjs +24 -0
- package/schema/check-brand.mjs +24 -0
- package/schema/check-config.mjs +110 -0
- package/schema/check-nextjs-status.mjs +3 -1
- package/schema/check-people.mjs +70 -0
- package/schema/check-sources.mjs +9 -1
- package/schema/data-model.json +334 -8
- package/schema/deal.schema.json +80 -0
- package/schema/decisions.mjs +7 -1
- package/schema/examples/frames/judge.mjs +10 -0
- package/schema/examples/venture-type/jev.mjs +12 -0
- package/schema/examples/workspace/ventures/acme-labs/AGENTS.md +17 -0
- package/schema/examples/workspace/ventures/acme-labs/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/discovery-goal.decision.json +23 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/statement-icp.decision.json +22 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/statement-problem.decision.json +22 -0
- package/schema/examples/workspace/ventures/acme-labs/decisions/venture.team.decision.json +37 -0
- package/schema/examples/workspace/ventures/acme-labs/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/acme-labs/knowledge/sources.json +46 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000001.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000002.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000003.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000004.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000005.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000006.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000007.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000008.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000009.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000010.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000011.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000012.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000013.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/30000000-0000-4000-8000-000000000014.json +12 -0
- package/schema/examples/workspace/ventures/acme-labs/money/_streams/transactions/stream.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/money/_summary.json +30 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/customer-service/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/customer-service/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/human-capital/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/it/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/it/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/marketing-and-sales/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/marketing-and-sales/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/products/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/products/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/strategy/README.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/operations/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/acme-labs/people/founders/maya-chen.json +15 -0
- package/schema/examples/workspace/ventures/acme-labs/people/people.json +22 -0
- package/schema/examples/workspace/ventures/acme-labs/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/acme-labs/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/acme-labs/products/decisions/product.core-product.decision.json +28 -0
- package/schema/examples/workspace/ventures/acme-labs/products/decisions/product.exists.decision.json +38 -0
- package/schema/examples/workspace/ventures/acme-labs/products/decisions/product.flagship.decision.json +27 -0
- package/schema/examples/workspace/ventures/acme-labs/profile.md +12 -0
- package/schema/examples/workspace/ventures/acme-labs/provenance.jsonl +12 -0
- package/schema/examples/workspace/ventures/acme-labs/raw/dump.md +6 -0
- package/schema/examples/workspace/ventures/acme-labs/venture.json +27 -0
- package/schema/examples/workspace/ventures/northstar/AGENTS.md +17 -0
- package/schema/examples/workspace/ventures/northstar/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/deals/ductline.json +8 -0
- package/schema/examples/workspace/ventures/northstar/deals/kilnworks.json +14 -0
- package/schema/examples/workspace/ventures/northstar/decisions/venture.team.decision.json +31 -0
- package/schema/examples/workspace/ventures/northstar/evidence/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/fund/decisions/terms.decision.json +27 -0
- package/schema/examples/workspace/ventures/northstar/fund/decisions/terms.first-close.decision.json +27 -0
- package/schema/examples/workspace/ventures/northstar/fund/decisions/thesis.decision.json +26 -0
- package/schema/examples/workspace/ventures/northstar/fund/terms.json +22 -0
- package/schema/examples/workspace/ventures/northstar/fund/thesis.json +22 -0
- package/schema/examples/workspace/ventures/northstar/governance/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/external-relationships/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/external-relationships/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/finance/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/human-capital/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/risk-and-compliance/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/risk-and-compliance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/strategy/charter.md +5 -0
- package/schema/examples/workspace/ventures/northstar/governance/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/operations/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/external-relationships/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/external-relationships/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/human-capital/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/risk-and-compliance/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/risk-and-compliance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/strategy/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/operations/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/people/founders/ana-ruiz.json +13 -0
- package/schema/examples/workspace/ventures/northstar/people/founders/ben-okafor.json +7 -0
- package/schema/examples/workspace/ventures/northstar/people/people.json +27 -0
- package/schema/examples/workspace/ventures/northstar/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/northstar/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/northstar/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/AGENTS.md +17 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/accounts/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/decisions/venture.team.decision.json +31 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/knowledge/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/customer-service/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/customer-service/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/finance/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/finance/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/human-capital/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/human-capital/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/it/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/it/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/marketing-and-sales/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/marketing-and-sales/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/products/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/products/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/strategy/README.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/operations/departments/strategy/department.json +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/pillars/brand.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/pillars/business.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/pillars/product.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/decisions/product.core-product.decision.json +28 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/decisions/product.exists.decision.json +32 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/products/decisions/product.flagship.decision.json +27 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/profile.md +5 -0
- package/schema/examples/workspace/ventures/northstar/portfolio/kilnworks/venture.json +27 -0
- package/schema/examples/workspace/ventures/northstar/products/.gitkeep +0 -0
- package/schema/examples/workspace/ventures/northstar/profile.md +5 -0
- package/schema/examples/workspace/ventures/northstar/provenance.jsonl +3 -0
- package/schema/examples/workspace/ventures/northstar/purpose/README.md +3 -0
- package/schema/examples/workspace/ventures/northstar/venture.json +49 -0
- package/schema/founder.schema.json +72 -0
- package/schema/frame.schema.json +240 -0
- package/schema/frames.mjs +228 -0
- package/schema/freshness-log.schema.json +40 -0
- package/schema/freshness-profiles.schema.json +44 -0
- package/schema/freshness.mjs +473 -0
- package/schema/fund-terms.schema.json +107 -0
- package/schema/fund-thesis.schema.json +87 -0
- package/schema/gate-drafts.mjs +130 -0
- package/schema/gate.mjs +105 -11
- package/schema/glossary.schema.json +25 -0
- package/schema/init-venture.mjs +38 -8
- package/schema/judgment.schema.json +38 -0
- package/schema/kit.schema.json +47 -0
- package/schema/kits.mjs +24 -0
- package/schema/knowledge-sources.schema.json +145 -15
- package/schema/layer.json +16 -3
- package/schema/marketing-brand.schema.json +116 -0
- package/schema/migrations/kit-to-package.mjs +94 -0
- package/schema/migrations/package-layout.mjs +86 -0
- package/schema/model-steps.mjs +717 -0
- package/schema/money-summary.schema.json +138 -0
- package/schema/naive-config.mjs +165 -0
- package/schema/naive-config.schema.json +268 -0
- package/schema/need-now.json +171 -0
- package/schema/need-now.mjs +3 -2
- package/schema/packages.mjs +10 -5
- package/schema/people.schema.json +86 -0
- package/schema/public-assets.schema.json +76 -0
- package/schema/release-read.mjs +111 -0
- package/schema/releases.mjs +497 -0
- package/schema/setup.mjs +164 -0
- package/schema/stale.mjs +111 -0
- package/schema/start-release.mjs +41 -0
- package/schema/structure.mjs +186 -0
- package/schema/systems-catalog.json +126 -0
- package/schema/systems-catalog.schema.json +78 -0
- package/schema/trigger.schema.json +44 -0
- package/schema/triggers.mjs +237 -0
- package/schema/upgrade-registry.schema.json +60 -0
- package/schema/upgrade-venture.mjs +96 -118
- package/schema/upgrades.json +69 -0
- package/schema/upgrades.mjs +385 -0
- package/schema/validate.py +19 -10
- package/schema/venture-role.schema.json +64 -0
- package/schema/venture-type.mjs +62 -0
- package/schema/venture-types.json +346 -0
- package/schema/venture-types.schema.json +129 -0
- package/schema/venture.schema.json +53 -0
|
@@ -1,129 +1,107 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// naive upgrade: moves one venture onto the
|
|
3
|
-
// (EE-
|
|
4
|
-
// them, wherever the venture's repository is, and with a plain rename when it does not.
|
|
5
|
-
// Provenance is appended, never rewritten: each move is a new line, and the set of moves
|
|
6
|
-
// is one release under .release/. Old routes keep resolving through interface/route-aliases.json.
|
|
2
|
+
// naive upgrade: moves one venture onto the installed Naive, like next upgrade and its codemods
|
|
3
|
+
// (EE-076, U-1 to U-6). The work is in schema/upgrades.mjs; this is its command line.
|
|
7
4
|
//
|
|
8
|
-
// node schema/upgrade-venture.mjs <venture dir>
|
|
5
|
+
// node schema/upgrade-venture.mjs <venture dir> run the migrations and pin the framework and packages
|
|
6
|
+
// node schema/upgrade-venture.mjs <venture dir> --check say what it would do; change nothing
|
|
7
|
+
// node schema/upgrade-venture.mjs <venture dir> --guide [x.y.z] the guide for each version it crosses, or for one
|
|
8
|
+
// node schema/upgrade-venture.mjs <venture dir> --canary|--stable the channel (experimental packages need canary)
|
|
9
|
+
// node schema/upgrade-venture.mjs <venture dir> --adopt <package> adopt a later phase's package now
|
|
10
|
+
// node schema/upgrade-venture.mjs <venture dir> --drop <package> undo that
|
|
11
|
+
// node schema/upgrade-venture.mjs <venture dir> --stage upgrade a copy under .naive/upgrade/ and run the checks
|
|
12
|
+
// node schema/upgrade-venture.mjs <venture dir> --agent the same, with an agent working the copy (a Mentura kit)
|
|
13
|
+
// node schema/upgrade-venture.mjs <venture dir> --status the staged upgrade and its checks
|
|
14
|
+
// node schema/upgrade-venture.mjs <venture dir> --accept --confirm upgrade land a staged upgrade whose checks pass
|
|
15
|
+
// node schema/upgrade-venture.mjs <venture dir> --reject discard it
|
|
16
|
+
// node schema/upgrade-venture.mjs --framework [<venture dir>] update the installed framework first (git pull --ff-only)
|
|
17
|
+
//
|
|
18
|
+
// Files move with git mv when git tracks them. Provenance is appended, never rewritten. Old routes keep
|
|
19
|
+
// resolving through interface/route-aliases.json. --json prints the result as JSON.
|
|
9
20
|
|
|
10
|
-
import {
|
|
11
|
-
import { existsSync,
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
21
|
+
import { spawnSync } from "node:child_process";
|
|
22
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
23
|
+
import { join, resolve } from "node:path";
|
|
24
|
+
import { accept, adopt, check, CONFIRM, draft, drop, guide, plan, registry, reject, setChannel, stage, updateFramework, upgrade } from "./upgrades.mjs";
|
|
25
|
+
import { kitFor } from "./kits.mjs";
|
|
14
26
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
27
|
+
const argv = process.argv.slice(2);
|
|
28
|
+
const has = (n) => argv.includes(`--${n}`);
|
|
29
|
+
const opt = (n) => { const i = argv.indexOf(`--${n}`); return i >= 0 && argv[i + 1] && !argv[i + 1].startsWith("--") ? argv[i + 1] : undefined; };
|
|
30
|
+
const valued = new Set(["guide", "adopt", "drop", "confirm", "by"]);
|
|
31
|
+
const dirArg = argv.find((a, i) => !a.startsWith("--") && !(i > 0 && valued.has(argv[i - 1].slice(2))));
|
|
32
|
+
const json = has("json");
|
|
33
|
+
const say = (x, text) => console.log(json ? JSON.stringify(x, null, 2) : text);
|
|
34
|
+
const fail = (e) => { console.error(e.message ?? String(e)); process.exit(1); };
|
|
35
|
+
const usage = () => { console.error("usage: node schema/upgrade-venture.mjs <venture dir> [--check | --guide [version] | --canary | --stable | --adopt <package> | --drop <package> | --stage | --agent | --status | --accept --confirm upgrade | --reject] [--json]\n node schema/upgrade-venture.mjs --framework [<venture dir>]"); process.exit(2); };
|
|
23
36
|
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// A decision file infers its target from the folder it sits in. Stamp that path before the
|
|
35
|
-
// file moves, so the decision still points at the same record.
|
|
36
|
-
function stampDecisions(folder) {
|
|
37
|
-
const d = join(dir, folder);
|
|
38
|
-
if (!existsSync(d)) return;
|
|
39
|
-
for (const f of readdirSync(d).filter((x) => x.endsWith(".decision.json"))) {
|
|
40
|
-
const path = join(d, f);
|
|
41
|
-
const rec = load(path);
|
|
42
|
-
if (rec.decides?.path) continue;
|
|
43
|
-
const at = folder.split("/").slice(0, -1).join("/");
|
|
44
|
-
const base = f.split(".")[0];
|
|
45
|
-
rec.decides = { ...(rec.decides ?? {}), path: at ? `${at}/${base}.json` : `${base}.json` };
|
|
46
|
-
writeFileSync(path, JSON.stringify(rec, null, 2) + "\n");
|
|
47
|
-
}
|
|
37
|
+
if (has("framework")) {
|
|
38
|
+
const r = updateFramework();
|
|
39
|
+
if (!r.ok) fail(new Error(r.error));
|
|
40
|
+
console.log(r.commits ? `updated Naive from ${r.from} to ${r.to} (${r.commits} commits)` : `Naive ${r.to} is up to date`);
|
|
41
|
+
if (!dirArg) process.exit(0);
|
|
42
|
+
// The upgrade runs in the code just pulled, not the code this process loaded.
|
|
43
|
+
const rest = argv.filter((a) => a !== "--framework");
|
|
44
|
+
process.exit(spawnSync("node", [new URL(import.meta.url).pathname, ...rest], { stdio: "inherit" }).status ?? 1);
|
|
48
45
|
}
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
["purpose/alignment.json", "foundation/alignment.json"],
|
|
54
|
-
["purpose/telos.draft.md", "foundation/telos.draft.md"],
|
|
55
|
-
["purpose/validation/solution.json", "validation/solution.json"],
|
|
56
|
-
["purpose/validation/go-to-market.json", "validation/go-to-market.json"],
|
|
57
|
-
["operations/team-plan.json", "people/team-plan.json"],
|
|
58
|
-
["pillars/brand.md", "marketing/brand.md"],
|
|
59
|
-
// A venture made since init writes a root AGENTS.md keeps it; the old README becomes the knowledge layout.
|
|
60
|
-
["knowledge/README.md", existsSync(join(dir, "AGENTS.md")) ? "knowledge/AGENTS.md" : "AGENTS.md"],
|
|
61
|
-
["purpose/anatomy.answers.reasoned.json", "product/anatomy.answers.reasoned.json"],
|
|
62
|
-
["purpose/anatomy.matrix.md", "product/anatomy.matrix.md"],
|
|
63
|
-
];
|
|
64
|
-
for (const [a, b] of pairs) mv(a, b);
|
|
47
|
+
if (!dirArg || !existsSync(join(dirArg, "venture.json"))) usage();
|
|
48
|
+
const dir = resolve(dirArg);
|
|
49
|
+
const id = JSON.parse(readFileSync(join(dir, "venture.json"), "utf8")).id;
|
|
65
50
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
51
|
+
try {
|
|
52
|
+
if (has("guide")) {
|
|
53
|
+
const reg = registry();
|
|
54
|
+
const versions = opt("guide") ? [opt("guide")] : plan(dir).steps.map((s) => s.version);
|
|
55
|
+
if (!versions.length) { say({ guides: [] }, `${id} is on Naive ${reg.framework}: no guide to read`); process.exit(0); }
|
|
56
|
+
const gs = versions.map((v) => guide(v, { reg }) ?? { version: v, path: null, text: `Naive ${v} has no guide.` });
|
|
57
|
+
say(gs, gs.map((g) => `${g.path ? `# ${g.path}\n\n` : ""}${g.text.replace(/^---\n[\s\S]*?\n---\n\n?/, "")}`).join("\n"));
|
|
58
|
+
} else if (has("canary") || has("stable")) {
|
|
59
|
+
const r = setChannel(dir, has("canary") ? "canary" : "stable");
|
|
60
|
+
say(r, r.changed ? `${id} is on the ${r.channel} channel` : `${id} was already on the ${r.channel} channel`);
|
|
61
|
+
} else if (opt("adopt")) {
|
|
62
|
+
const r = adopt(dir, opt("adopt"));
|
|
63
|
+
say(r, r.changed ? `adopted ${r.name} ${r.version} early${r.channel === "experimental" ? " (experimental)" : ""}: it opens now in the venture package` : r.note);
|
|
64
|
+
} else if (opt("drop")) {
|
|
65
|
+
const r = drop(dir, opt("drop"));
|
|
66
|
+
say(r, `dropped ${r.name}: it fits by its phase again`);
|
|
67
|
+
} else if (has("stage")) {
|
|
68
|
+
await stage(dir);
|
|
69
|
+
const d = check(dir);
|
|
70
|
+
report(d);
|
|
71
|
+
} else if (has("agent")) {
|
|
72
|
+
// The agent-run upgrade is a Mentura kit (U-3, I-29): the framework finds it and runs it as its own process.
|
|
73
|
+
const k = kitFor("upgrade --agent");
|
|
74
|
+
if (!k) fail(new Error("an agent-run upgrade is a Mentura kit (platform/kits/agent-upgrade), and none is installed here; --stage upgrades a copy without an agent"));
|
|
75
|
+
process.exit(spawnSync("node", [join(k.dir, k.entry), dir, ...(json ? ["--json"] : [])], { stdio: "inherit" }).status ?? 1);
|
|
76
|
+
} else if (has("status")) {
|
|
77
|
+
const d = draft(dir);
|
|
78
|
+
if (!d) { say(null, `no upgrade is staged for ${id}`); process.exit(0); }
|
|
79
|
+
report(check(dir));
|
|
80
|
+
} else if (has("accept")) {
|
|
81
|
+
const r = await accept(dir, { confirm: opt("confirm"), by: opt("by") ?? process.env.MENTURA_PERSON });
|
|
82
|
+
say(r, `accepted: ${id} is on Naive ${r.accepted} (${r.added} added, ${r.changed} changed, ${r.removed} removed)`);
|
|
83
|
+
} else if (has("reject")) {
|
|
84
|
+
say(reject(dir), `rejected the staged upgrade of ${id}; the venture is as it was`);
|
|
85
|
+
} else {
|
|
86
|
+
const r = await upgrade(dir, { dry: has("check") });
|
|
87
|
+
if (json) { console.log(JSON.stringify(r, null, 2)); process.exit(0); }
|
|
88
|
+
const moves = r.release.migrations.reduce((n, m) => n + m.moves.length, 0), rewrites = r.release.migrations.reduce((n, m) => n + m.rewrote.length, 0);
|
|
89
|
+
const pinned = r.packages.filter((x) => !x.missing && x.from !== x.to);
|
|
90
|
+
if (!r.pending && !r.changed) console.log(`${id} is on Naive ${r.to}, every package pinned: nothing to upgrade.`);
|
|
91
|
+
else console.log(`${r.dry ? "would upgrade" : "upgraded"} ${id} from Naive ${r.from} to ${r.to}: ${moves} files moved, ${rewrites} records rewritten, ${pinned.length} packages pinned, ${r.release.escalated.length} escalated for a decision.`);
|
|
92
|
+
for (const m of r.release.migrations) if (m.moves.length || m.rewrote.length || m.notes.length) console.log(`migrate ${m.id} (${m.version}): ${m.moves.length} moved, ${m.rewrote.length} rewritten${m.notes.length ? `; ${m.notes.join("; ")}` : ""}`);
|
|
93
|
+
for (const e of r.release.escalated) console.log(`escalate ${e}`);
|
|
94
|
+
for (const g of r.release.guides) console.log(`guide ${g}`);
|
|
95
|
+
if (r.release.guides.length) console.log(`Read the guides: node interface/cli/naive.mjs upgrade ${dirArg} --guide`);
|
|
90
96
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function removeEmpty(p) {
|
|
94
|
-
if (!existsSync(p)) return;
|
|
95
|
-
for (const e of readdirSync(p, { withFileTypes: true })) if (e.isDirectory()) removeEmpty(join(p, e.name));
|
|
96
|
-
if (readdirSync(p).length === 0) rmSync(p, { recursive: true });
|
|
97
|
-
}
|
|
98
|
-
for (const gone of ["purpose", "pillars", "knowledge", "products"]) removeEmpty(join(dir, gone));
|
|
99
|
-
|
|
100
|
-
const policy = join(dir, "governance/publication-policy.json");
|
|
101
|
-
if (existsSync(policy)) {
|
|
102
|
-
const text = readFileSync(policy, "utf8");
|
|
103
|
-
if (text.includes("pillars/brand.md")) writeFileSync(policy, text.replaceAll("pillars/brand.md", "marketing/brand.md"));
|
|
104
|
-
}
|
|
97
|
+
} catch (e) { fail(e); }
|
|
105
98
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
function report(d) {
|
|
100
|
+
if (json) { console.log(JSON.stringify(d, null, 2)); return; }
|
|
101
|
+
console.log(`staged upgrade of ${id} from Naive ${d.from} to ${d.to}${d.by && d.by !== "naive" ? `, worked by ${d.by}` : ""}: ${d.status}`);
|
|
102
|
+
if (d.changes) console.log(`changes ${d.changes.added.length} added, ${d.changes.changed.length} changed, ${d.changes.removed.length} removed`);
|
|
103
|
+
for (const c of d.checks ?? []) console.log(`${c.passed ? "pass" : "FAIL"} ${c.check}${c.passed ? "" : `: ${c.output.split("\n").slice(-2).join(" / ")}`}`);
|
|
104
|
+
for (const e of d.escalated ?? []) console.log(`escalate ${e}`);
|
|
105
|
+
if (d.status === "ready") console.log(`Nothing has landed. To land it: node interface/cli/naive.mjs upgrade ${dirArg} --accept --confirm ${CONFIRM}`);
|
|
106
|
+
else if (d.status === "checks-failed") console.log(`Nothing has landed, and it cannot until the checks pass. Fix the copy in ${dirArg}/.naive/upgrade/venture and run --status, or --reject.`);
|
|
109
107
|
}
|
|
110
|
-
|
|
111
|
-
const release = {
|
|
112
|
-
version: 1,
|
|
113
|
-
at: new Date().toISOString().replace(/\.\d+Z$/, "Z"),
|
|
114
|
-
note: "Moved onto the package folder layout (EE-070). Old routes stay as aliases for one release.",
|
|
115
|
-
moves: moved.map(([from, to]) => ({ from, to })),
|
|
116
|
-
escalated,
|
|
117
|
-
};
|
|
118
|
-
mkdirSync(join(dir, ".release"), { recursive: true });
|
|
119
|
-
const releaseRel = ".release/layout.json";
|
|
120
|
-
writeFileSync(join(dir, releaseRel), JSON.stringify(release, null, 2) + "\n");
|
|
121
|
-
|
|
122
|
-
const agent = { kind: "agent", id: "grokbot", via: "cli" };
|
|
123
|
-
for (const [from, to] of moved) {
|
|
124
|
-
record(dir, { entity: to, activity: "move", agent, derived_from: [from], note: `moved from ${from} (EE-070)` });
|
|
125
|
-
}
|
|
126
|
-
record(dir, { entity: releaseRel, activity: "release", agent, derived_from: moved.map(([, to]) => to), note: "package folder layout" });
|
|
127
|
-
|
|
128
|
-
console.log(`upgraded ${load(join(dir, "venture.json")).id}: ${moved.length} files moved, ${escalated.length} archived for a decision.`);
|
|
129
|
-
for (const e of escalated) console.log(`escalate ${e}`);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"framework": "0.3.0",
|
|
3
|
+
"note": "Naive's versions, the migrations that move a venture from one to the next, and each package's version and channel (EE-076, the Next.js translation's chapter 18). naive upgrade reads this file from the installed copy, so a venture always upgrades to the framework it runs on. A version's guide is bundled here, in docs/upgrades/, so agents read the guide for the version installed (I-29).",
|
|
4
|
+
"channels": {
|
|
5
|
+
"stable": "Packages Naive models and computes fit for. The default.",
|
|
6
|
+
"canary": "Stable packages plus experimental ones: packages Naive does not model yet (fit is not computed), adopted only when a person asks for one by name."
|
|
7
|
+
},
|
|
8
|
+
"versions": [
|
|
9
|
+
{
|
|
10
|
+
"version": "0.1.0",
|
|
11
|
+
"date": "2026-10-27",
|
|
12
|
+
"summary": "The layer layout: records under purpose/, knowledge/, operations/, governance/ and pillars/ (EE-030, EE-032). A venture with no pin in naive.config.json is on this version.",
|
|
13
|
+
"guide": null,
|
|
14
|
+
"migrations": []
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"version": "0.2.0",
|
|
18
|
+
"date": "2026-10-29",
|
|
19
|
+
"summary": "The package folder layout: records move into foundation/, validation/, product/, marketing/, people/ and decisions/, with the old routes kept as aliases (EE-070).",
|
|
20
|
+
"guide": "docs/upgrades/0.2.0.md",
|
|
21
|
+
"migrations": ["package-layout"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"version": "0.3.0",
|
|
25
|
+
"date": "2026-10-29",
|
|
26
|
+
"summary": "Packages are Naive's and kits are Mentura's (EE-071): naive.config.json pins the framework and each package, and routes inside records are package routes.",
|
|
27
|
+
"guide": "docs/upgrades/0.3.0.md",
|
|
28
|
+
"migrations": ["kit-to-package"]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"migrations": [
|
|
32
|
+
{
|
|
33
|
+
"id": "package-layout",
|
|
34
|
+
"module": "schema/migrations/package-layout.mjs",
|
|
35
|
+
"package": null,
|
|
36
|
+
"decision": "EE-070",
|
|
37
|
+
"aliases": "interface/route-aliases.json"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "kit-to-package",
|
|
41
|
+
"module": "schema/migrations/kit-to-package.mjs",
|
|
42
|
+
"package": null,
|
|
43
|
+
"decision": "EE-071",
|
|
44
|
+
"aliases": "interface/route-aliases.json"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"packages": {
|
|
48
|
+
"foundation": { "version": "0.3.0", "channel": "stable" },
|
|
49
|
+
"validation": { "version": "0.3.0", "channel": "stable" },
|
|
50
|
+
"product": { "version": "0.3.0", "channel": "stable" },
|
|
51
|
+
"marketing": { "version": "0.3.0", "channel": "stable" },
|
|
52
|
+
"finance": { "version": "0.3.0", "channel": "stable" },
|
|
53
|
+
"people": { "version": "0.3.0", "channel": "stable" },
|
|
54
|
+
"investor": { "version": "0.3.0", "channel": "stable" },
|
|
55
|
+
"partner": { "version": "0.3.0", "channel": "stable" },
|
|
56
|
+
"cofounder": { "version": "0.3.0", "channel": "stable" },
|
|
57
|
+
"engineering": { "version": "0.3.0", "channel": "stable" },
|
|
58
|
+
"customers": { "version": "0.3.0", "channel": "stable" },
|
|
59
|
+
"investors": { "version": "0.3.0", "channel": "stable" },
|
|
60
|
+
"money": { "version": "0.3.0", "channel": "stable" },
|
|
61
|
+
"raw": { "version": "0.3.0", "channel": "stable" },
|
|
62
|
+
"decisions": { "version": "0.3.0", "channel": "stable" },
|
|
63
|
+
"evidence": { "version": "0.3.0", "channel": "stable" },
|
|
64
|
+
"legal": { "version": "0.3.0", "channel": "experimental", "note": "Not modeled: matters after Validation or under another governance model (EE-069)" },
|
|
65
|
+
"operations": { "version": "0.3.0", "channel": "experimental", "note": "Not modeled: matters after Validation or under another governance model (EE-069)" },
|
|
66
|
+
"relationships": { "version": "0.3.0", "channel": "experimental", "note": "Not modeled: matters after Validation or under another governance model (EE-069)" },
|
|
67
|
+
"counsel": { "version": "0.3.0", "channel": "experimental", "note": "Not modeled: co-owners, outside money or a regulated field (EE-069)" }
|
|
68
|
+
}
|
|
69
|
+
}
|