@namewta/speculo 1.0.5 → 1.0.7
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/README.md +1 -1
- package/dist/src/kernel.d.ts +23 -2
- package/dist/src/kernel.js +9 -0
- package/dist/src/kernel.js.map +1 -1
- package/dist/src/ops-resources.d.ts +3 -0
- package/dist/src/ops-resources.js +188 -0
- package/dist/src/ops-resources.js.map +1 -0
- package/dist/src/refresh.js +20 -2
- package/dist/src/refresh.js.map +1 -1
- package/dist/src/structured.js +7 -0
- package/dist/src/structured.js.map +1 -1
- package/dist/src/workflows.js +1 -1
- package/dist/src/workflows.js.map +1 -1
- package/package.json +1 -1
- package/template/.speculo/README.md +3 -3
- package/template/.speculo/kernel/README.md +3 -0
- package/template/.speculo/kernel/checkpoint.schema.json +138 -4
- package/template/commands/archive-and-consolidate.md +5 -1
- package/template/commands/status.md +2 -2
- package/template/workflows/ops/D-project-deploy/D-project-deploy.md +34 -0
- package/template/workflows/ops/H-host-manage/H-host-manage.md +30 -0
- package/template/workflows/ops/I-initialize/I-initialize.md +28 -0
- package/template/workflows/ops/INDEX.md +15 -17
- package/template/workflows/ops/README.md +59 -93
- package/template/workflows/ops/_state/status.json +15 -3
- package/template/workflows/ops/common/CAPABILITIES.md +23 -0
- package/template/workflows/ops/common/USAGE.md +112 -0
- package/template/workflows/ops/common/examples/README.md +7 -0
- package/template/workflows/ops/common/examples/binding.example.json +12 -0
- package/template/workflows/ops/common/examples/compose-app.example.json +56 -0
- package/template/workflows/ops/common/examples/credential.example.json +9 -0
- package/template/workflows/ops/common/examples/environment-request.example.json +7 -0
- package/template/workflows/ops/common/examples/register.example.json +44 -0
- package/template/workflows/ops/common/examples/shared-allocation.example.json +37 -0
- package/template/workflows/ops/common/rules/activation-and-memory.md +5 -20
- package/template/workflows/ops/common/rules/persistence-and-secrets.md +27 -0
- package/template/workflows/ops/common/rules/recovery.md +15 -0
- package/template/workflows/ops/common/rules/shared-services.md +13 -0
- package/template/workflows/ops/common/schemas/allocation.schema.json +92 -0
- package/template/workflows/ops/common/schemas/approval.schema.json +41 -21
- package/template/workflows/ops/common/schemas/binding.schema.json +73 -0
- package/template/workflows/ops/common/schemas/deployment.schema.json +244 -0
- package/template/workflows/ops/common/schemas/host.schema.json +88 -0
- package/template/workflows/ops/common/schemas/plan.schema.json +1573 -0
- package/template/workflows/ops/common/schemas/project.schema.json +55 -11
- package/template/workflows/ops/common/schemas/spec.schema.json +1032 -0
- package/template/workflows/ops/common/schemas/status.schema.json +758 -17
- package/template/workflows/ops/common/service-profiles/custom.md +5 -0
- package/template/workflows/ops/common/service-profiles/docker-engine.md +11 -0
- package/template/workflows/ops/common/service-profiles/minio.md +7 -0
- package/template/workflows/ops/common/service-profiles/mysql.md +7 -0
- package/template/workflows/ops/common/service-profiles/redis.md +7 -0
- package/template/workflows/ops/common/templates/CONTROLLER-RECORD.md +13 -0
- package/template/workflows/ops/common/templates/EXECUTION-PLAN.md +15 -0
- package/template/workflows/ops/common/templates/HOST-README.md +11 -0
- package/template/workflows/ops/common/templates/PROJECT-README.md +15 -0
- package/template/workflows/ops/common/tests/test_ops.mjs +752 -0
- package/template/workflows/ops/common/tools/bootstrap.ps1 +18 -0
- package/template/workflows/ops/common/tools/bootstrap.sh +27 -0
- package/template/workflows/ops/common/tools/demo-local.mjs +101 -0
- package/template/workflows/ops/common/tools/ops.mjs +4 -0
- package/template/workflows/ops/common/tools/opslib/agent.mjs +873 -0
- package/template/workflows/ops/common/tools/opslib/cli.mjs +311 -0
- package/template/workflows/ops/common/tools/opslib/core.mjs +393 -0
- package/template/workflows/ops/common/tools/opslib/docs.mjs +252 -0
- package/template/workflows/ops/common/tools/opslib/execution.mjs +378 -0
- package/template/workflows/ops/common/tools/opslib/host_recipes.mjs +109 -0
- package/template/workflows/ops/common/tools/opslib/model.mjs +272 -0
- package/template/workflows/ops/common/tools/opslib/native_windows.mjs +36 -0
- package/template/workflows/ops/common/tools/opslib/planner.mjs +687 -0
- package/template/workflows/ops/common/tools/opslib/services.mjs +76 -0
- package/template/workflows/ops/common/tools/opslib/sources.mjs +56 -0
- package/template/workflows/ops/common/tools/opslib/transport.mjs +127 -0
- package/template/workflows/ops/common/tools/validate-ops.mjs +43 -1012
- package/template/workflows/ops/manifest.json +60 -1
- package/template/workflows/ops/runtime-contract.json +1 -6
- package/template/workflows/ops/A-archive-and-learn/A-archive-and-learn.md +0 -73
- package/template/workflows/ops/A-archive-and-learn/promotion-plan-template.md +0 -41
- package/template/workflows/ops/A-archive-and-learn/retrospective-template.md +0 -53
- package/template/workflows/ops/E-execute-and-stabilize/E-execute-and-stabilize.md +0 -82
- package/template/workflows/ops/E-execute-and-stabilize/attempt-summary-template.md +0 -44
- package/template/workflows/ops/E-execute-and-stabilize/diagnosis-template.md +0 -24
- package/template/workflows/ops/E-execute-and-stabilize/handoff-template.md +0 -32
- package/template/workflows/ops/E-execute-and-stabilize/rollback-template.md +0 -26
- package/template/workflows/ops/E-execute-and-stabilize/verification-state-template.json +0 -30
- package/template/workflows/ops/E-execute-and-stabilize/verification-template.md +0 -55
- package/template/workflows/ops/H-computer-hygiene/H-computer-hygiene.md +0 -105
- package/template/workflows/ops/H-computer-hygiene/examples/README.md +0 -9
- package/template/workflows/ops/H-computer-hygiene/examples/linux/2026-09-14.environment.md +0 -45
- package/template/workflows/ops/H-computer-hygiene/examples/linux/2026-09-14.json +0 -970
- package/template/workflows/ops/H-computer-hygiene/examples/linux/2026-09-14.md +0 -216
- package/template/workflows/ops/H-computer-hygiene/examples/macos/2026-09-14.environment.md +0 -45
- package/template/workflows/ops/H-computer-hygiene/examples/macos/2026-09-14.json +0 -970
- package/template/workflows/ops/H-computer-hygiene/examples/macos/2026-09-14.md +0 -216
- package/template/workflows/ops/H-computer-hygiene/examples/windows/2026-09-14.environment.md +0 -45
- package/template/workflows/ops/H-computer-hygiene/examples/windows/2026-09-14.json +0 -969
- package/template/workflows/ops/H-computer-hygiene/examples/windows/2026-09-14.md +0 -216
- package/template/workflows/ops/H-computer-hygiene/references/00-sources.md +0 -58
- package/template/workflows/ops/H-computer-hygiene/references/01-safety.md +0 -52
- package/template/workflows/ops/H-computer-hygiene/references/10-windows.md +0 -47
- package/template/workflows/ops/H-computer-hygiene/references/11-macos.md +0 -46
- package/template/workflows/ops/H-computer-hygiene/references/12-linux.md +0 -13
- package/template/workflows/ops/H-computer-hygiene/references/20-toolchains.md +0 -83
- package/template/workflows/ops/H-computer-hygiene/references/21-path-migration.md +0 -64
- package/template/workflows/ops/H-computer-hygiene/references/22-repositories.md +0 -35
- package/template/workflows/ops/H-computer-hygiene/references/30-software-removal.md +0 -41
- package/template/workflows/ops/H-computer-hygiene/references/40-report-spec.md +0 -54
- package/template/workflows/ops/H-computer-hygiene/references/50-speculo-integration.md +0 -26
- package/template/workflows/ops/H-computer-hygiene/references/source-register.json +0 -406
- package/template/workflows/ops/H-computer-hygiene/rules/catalog.json +0 -191
- package/template/workflows/ops/H-computer-hygiene/scripts/hygiene.py +0 -1348
- package/template/workflows/ops/H-computer-hygiene/scripts/run.ps1 +0 -7
- package/template/workflows/ops/H-computer-hygiene/scripts/run.sh +0 -5
- package/template/workflows/ops/H-computer-hygiene/templates/config.example.json +0 -13
- package/template/workflows/ops/H-computer-hygiene/templates/maven-settings.fragment.xml +0 -6
- package/template/workflows/ops/H-computer-hygiene/templates/native-evidence.example.json +0 -19
- package/template/workflows/ops/H-computer-hygiene/tests/cli_smoke.py +0 -65
- package/template/workflows/ops/H-computer-hygiene/tests/make_examples.py +0 -114
- package/template/workflows/ops/H-computer-hygiene/tests/test_hygiene.py +0 -486
- package/template/workflows/ops/I-intake-and-assess/I-intake-and-assess.md +0 -73
- package/template/workflows/ops/I-intake-and-assess/change-status-template.json +0 -26
- package/template/workflows/ops/I-intake-and-assess/collector-catalog.md +0 -28
- package/template/workflows/ops/I-intake-and-assess/deployment-dossier-template.md +0 -62
- package/template/workflows/ops/I-intake-and-assess/global-change-status-template.json +0 -26
- package/template/workflows/ops/I-intake-and-assess/project-detection.md +0 -38
- package/template/workflows/ops/I-intake-and-assess/request-template.md +0 -44
- package/template/workflows/ops/I-intake-and-assess/system-report-template.md +0 -34
- package/template/workflows/ops/I-intake-and-assess/target-profile-template.json +0 -24
- package/template/workflows/ops/P-plan-and-approve/P-plan-and-approve.md +0 -72
- package/template/workflows/ops/P-plan-and-approve/plan-review-template.md +0 -78
- package/template/workflows/ops/_state/archive/.gitkeep +0 -1
- package/template/workflows/ops/_state/changes/.gitkeep +0 -1
- package/template/workflows/ops/common/rules/artifact-contract.md +0 -38
- package/template/workflows/ops/common/rules/closure-and-learning.md +0 -27
- package/template/workflows/ops/common/rules/evidence-and-redaction.md +0 -22
- package/template/workflows/ops/common/rules/execution-loop.md +0 -27
- package/template/workflows/ops/common/rules/path-and-scope-contract.md +0 -21
- package/template/workflows/ops/common/rules/plan-and-approval.md +0 -25
- package/template/workflows/ops/common/rules/project-and-change-scope.md +0 -20
- package/template/workflows/ops/common/rules/target-profile-and-release-gates.md +0 -44
- package/template/workflows/ops/common/schemas/attempt.schema.json +0 -42
- package/template/workflows/ops/common/schemas/change-status.schema.json +0 -43
- package/template/workflows/ops/common/schemas/deployment-model.schema.json +0 -26
- package/template/workflows/ops/common/schemas/implementation-plan.schema.json +0 -221
- package/template/workflows/ops/common/schemas/inventory-snapshot.schema.json +0 -31
- package/template/workflows/ops/common/schemas/journal-event.schema.json +0 -22
- package/template/workflows/ops/common/schemas/promotion-approval.schema.json +0 -20
- package/template/workflows/ops/common/schemas/promotion-manifest.schema.json +0 -22
- package/template/workflows/ops/common/schemas/target-profile.schema.json +0 -32
- package/template/workflows/ops/common/schemas/verification-state.schema.json +0 -30
- package/template/workflows/ops/common/tools/close-change.mjs +0 -177
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
param([switch]$Probe,[string]$Apply,[string]$Sha256,[string]$Approval)
|
|
2
|
+
$ErrorActionPreference='Stop'
|
|
3
|
+
if (-not $Apply) {
|
|
4
|
+
Write-Output 'OPS bootstrap inventory (read-only; no extra runtime prerequisite beyond this probe)'
|
|
5
|
+
Get-CimInstance Win32_OperatingSystem | Select-Object Caption,Version,OSArchitecture,FreePhysicalMemory,TotalVisibleMemorySize
|
|
6
|
+
'ssh','git','python','py','uv','node','npm','java','docker','volta' | ForEach-Object {
|
|
7
|
+
$c=Get-Command $_ -ErrorAction SilentlyContinue
|
|
8
|
+
[pscustomobject]@{Tool=$_;Path=if($c){$c.Source}else{'missing'}}
|
|
9
|
+
}
|
|
10
|
+
exit 0
|
|
11
|
+
}
|
|
12
|
+
if ($Approval -ne 'I-APPROVE-THIS-BOOTSTRAP') { throw 'Explicit bootstrap approval is required' }
|
|
13
|
+
$f=Get-Item -LiteralPath $Apply
|
|
14
|
+
if ($f.Attributes -band [IO.FileAttributes]::ReparsePoint) { throw 'Reparse-point installer is not accepted' }
|
|
15
|
+
if ((Get-FileHash -LiteralPath $Apply -Algorithm SHA256).Hash.ToLowerInvariant() -ne $Sha256.ToLowerInvariant()) { throw 'Installer changed since review' }
|
|
16
|
+
& $f.FullName
|
|
17
|
+
if (-not $?) { throw 'Bootstrap installer failed' }
|
|
18
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) { throw 'Node still unavailable; not completed' }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# First-stage controller/target bootstrap: POSIX shell only, no Python prerequisite.
|
|
3
|
+
set -eu
|
|
4
|
+
case "${1:---probe}" in
|
|
5
|
+
--probe)
|
|
6
|
+
printf 'OPS bootstrap inventory (read-only)\n'
|
|
7
|
+
uname -srm
|
|
8
|
+
for tool in ssh git node npm uv python3 python java docker volta curl wget sha256sum shasum; do
|
|
9
|
+
if command -v "$tool" >/dev/null 2>&1; then printf '%s=%s\n' "$tool" "$(command -v "$tool")"; else printf '%s=missing\n' "$tool"; fi
|
|
10
|
+
done
|
|
11
|
+
printf 'No software installed. Review a version-pinned OS/package-manager installer before --apply.\n'
|
|
12
|
+
;;
|
|
13
|
+
--apply)
|
|
14
|
+
# Explicit file+digest approval, no curl|sh, eval, hidden downloads or "latest" installers.
|
|
15
|
+
[ "$#" -eq 4 ] || { echo 'usage: bootstrap.sh --apply reviewed-script.sh SHA256 I-APPROVE-THIS-BOOTSTRAP' >&2; exit 2; }
|
|
16
|
+
[ "$4" = 'I-APPROVE-THIS-BOOTSTRAP' ] || exit 2
|
|
17
|
+
[ -f "$2" ] && [ ! -L "$2" ] || { echo 'Installer must be a reviewed regular file' >&2; exit 2; }
|
|
18
|
+
if command -v sha256sum >/dev/null 2>&1; then actual=$(sha256sum "$2" | cut -d' ' -f1)
|
|
19
|
+
elif command -v shasum >/dev/null 2>&1; then actual=$(shasum -a 256 "$2" | cut -d' ' -f1)
|
|
20
|
+
else echo 'No SHA-256 implementation; bootstrap blocked' >&2; exit 2; fi
|
|
21
|
+
[ "$actual" = "$3" ] || { echo 'Installer changed after review' >&2; exit 2; }
|
|
22
|
+
printf 'Executing explicitly approved bootstrap sha256=%s\n' "$actual"
|
|
23
|
+
/bin/sh "$2"
|
|
24
|
+
command -v node >/dev/null 2>&1 || { echo 'Node still missing; not completed' >&2; exit 2; }
|
|
25
|
+
;;
|
|
26
|
+
*) echo 'usage: bootstrap.sh --probe | --apply FILE SHA256 I-APPROVE-THIS-BOOTSTRAP' >&2; exit 2;;
|
|
27
|
+
esac
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/** Real disposable local deployment. No network, system installation, or existing-root writes. */
|
|
3
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync } from "node:fs";
|
|
4
|
+
import { join, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { initialize } from "./opslib/cli.mjs";
|
|
7
|
+
import { writeJson, OpsError, readJson } from "./opslib/core.mjs";
|
|
8
|
+
import { register, putCredential } from "./opslib/model.mjs";
|
|
9
|
+
import { probeLocal } from "./opslib/transport.mjs";
|
|
10
|
+
import { compilePlan } from "./opslib/planner.mjs";
|
|
11
|
+
import { approval, apply } from "./opslib/execution.mjs";
|
|
12
|
+
|
|
13
|
+
export function run(output) {
|
|
14
|
+
output = resolve(output);
|
|
15
|
+
if (existsSync(output) && readdirSync(output).length) {
|
|
16
|
+
throw new OpsError("demo output must be a new/empty directory, never your real state or target root");
|
|
17
|
+
}
|
|
18
|
+
mkdirSync(output, { recursive: true });
|
|
19
|
+
const state = join(output, "controller");
|
|
20
|
+
const target = join(output, "server");
|
|
21
|
+
initialize(state, "demo-controller");
|
|
22
|
+
const inventory = probeLocal();
|
|
23
|
+
const platform = inventory.platform;
|
|
24
|
+
if (!["linux", "darwin", "windows"].includes(platform)) throw new OpsError("unsupported platform");
|
|
25
|
+
register(state, {
|
|
26
|
+
hosts: [{
|
|
27
|
+
host_id: "demo-local", display_name: "Disposable local demo", platform, transport: "local",
|
|
28
|
+
connection: {}, root: target, identity: inventory.identity,
|
|
29
|
+
}],
|
|
30
|
+
projects: [{
|
|
31
|
+
project_id: "app-a", display_name: "Demo APP A", kind: "app", service_type: null,
|
|
32
|
+
source: { type: "local", location: join(output, "fixture-source"), revision: "demo-v1" },
|
|
33
|
+
}],
|
|
34
|
+
});
|
|
35
|
+
const password = "DEMO-ONLY-$literal-quote\"-not-a-real-password";
|
|
36
|
+
putCredential(state, {
|
|
37
|
+
credential_id: "demo-auth", version: 1,
|
|
38
|
+
purpose: "Disposable example only; never use in production",
|
|
39
|
+
values: { username: "demo-admin", password },
|
|
40
|
+
});
|
|
41
|
+
const program = `import { mkdirSync, writeFileSync } from "node:fs";
|
|
42
|
+
import { join } from "node:path";
|
|
43
|
+
const root = join(process.env.OPS_DATA_ROOT, "app", "storage");
|
|
44
|
+
mkdirSync(root, { recursive: true });
|
|
45
|
+
if (process.env.APP_USERNAME !== "demo-admin") throw new Error("username");
|
|
46
|
+
if (!process.env.APP_PASSWORD.startsWith("DEMO-ONLY-")) throw new Error("password");
|
|
47
|
+
writeFileSync(join(root, "record.json"), JSON.stringify({ version: "demo-v1", count: 1, environment_injected: true }));
|
|
48
|
+
`;
|
|
49
|
+
const spec = {
|
|
50
|
+
schema_version: 1, worker: "D", operation: "deploy",
|
|
51
|
+
reason: "Explicit disposable local demo; only this new output tree is written. No network or system install.",
|
|
52
|
+
rollback_note: "All files belong to the demo output. Keep evidence; no user data or shared service is touched.",
|
|
53
|
+
deployments: [{
|
|
54
|
+
deployment_id: "app-a-demo", project_id: "app-a", host_id: "demo-local", environment: "demo", instance: "main",
|
|
55
|
+
layout: "flat", method: "native", version: "demo-v1",
|
|
56
|
+
files: [{ path: "artifact/main.mjs", content: program }],
|
|
57
|
+
native: { supervisor: "oneshot", argv: [process.execPath, "{{artifact}}/main.mjs"] },
|
|
58
|
+
env: { "app.env": { APP_USERNAME: "{{credential:demo-auth@1:username}}", APP_PASSWORD: "{{credential:demo-auth@1:password}}" } },
|
|
59
|
+
credential_refs: ["demo-auth@1"],
|
|
60
|
+
health: [{ type: "file", path: "data/app/storage/record.json" }],
|
|
61
|
+
backup: "The finite process exits before backup. Demo has no shared dependencies. Actual backup must be a separately approved action.",
|
|
62
|
+
recovery: "Keep data/app/storage. Rerunning a different version requires a new approved plan.",
|
|
63
|
+
}],
|
|
64
|
+
};
|
|
65
|
+
writeJson(join(output, "demo-spec.json"), spec);
|
|
66
|
+
const plan = compilePlan(state, join(output, "demo-spec.json"));
|
|
67
|
+
approval(state, plan.run_id, plan.plan_digest, "demo-user", "I authorize only this fresh disposable demo directory and the exact generated fixture plan.");
|
|
68
|
+
const result = apply(state, plan.run_id);
|
|
69
|
+
if (result.status !== "completed") throw new OpsError("demo did not fully complete: " + JSON.stringify(result));
|
|
70
|
+
const local = join(state, "hosts", "demo-local", "deployments", "app-a-demo");
|
|
71
|
+
const readme = readFileSync(join(target, "app-a", "README.md"), "utf8");
|
|
72
|
+
if (readme.includes(password) || !readme.includes("demo-v1") || !readme.includes(join(target, "app-a", "data", "app", "storage"))) {
|
|
73
|
+
throw new OpsError("demo README checks failed");
|
|
74
|
+
}
|
|
75
|
+
if (!readFileSync(join(local, "README.md"), "utf8").includes(password)) throw new OpsError("controller README missing password");
|
|
76
|
+
if (!readFileSync(join(target, "app-a", "OPERATIONS.md"), "utf8").includes(password)) throw new OpsError("OPERATIONS.md missing password");
|
|
77
|
+
if (readJson(join(local, "docs-receipt.json")).status !== "both-sides-verified") throw new OpsError("docs receipt incomplete");
|
|
78
|
+
if (!readJson(join(target, "app-a", "data", "app", "storage", "record.json")).environment_injected) throw new OpsError("runtime data missing");
|
|
79
|
+
const report = {
|
|
80
|
+
...result, output, target_readme: join(target, "app-a", "README.md"), controller_record: join(local, "README.md"),
|
|
81
|
+
checks: {
|
|
82
|
+
runtime_data_in_project: true, native_env_injection: true, server_readme_no_password: true,
|
|
83
|
+
controller_plaintext_exact: true, server_operations_plaintext_exact: true, both_sides_verified: true,
|
|
84
|
+
},
|
|
85
|
+
scope: "real local filesystem and subprocess fixture; not a Docker/SSH/Windows-service production acceptance test",
|
|
86
|
+
};
|
|
87
|
+
writeJson(join(output, "DEMO-RESULT.json"), report);
|
|
88
|
+
return report;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
|
|
92
|
+
const args = process.argv.slice(2);
|
|
93
|
+
const i = args.indexOf("--output");
|
|
94
|
+
try {
|
|
95
|
+
if (i < 0 || !args[i + 1]) throw new OpsError("--output is required");
|
|
96
|
+
process.stdout.write(JSON.stringify(run(args[i + 1]), null, 2) + "\n");
|
|
97
|
+
} catch (exc) {
|
|
98
|
+
process.stderr.write(String(exc.message || exc) + "\n");
|
|
99
|
+
process.exit(2);
|
|
100
|
+
}
|
|
101
|
+
}
|