Public dry run dryrun-f1e9b7b784b4
Source commit: f1e9b7b784b4a4dd28799719681535e2a4ef44c9
This commit is contained in:
parent
20c72e6066
commit
8c0c336ae9
5 changed files with 1829 additions and 20 deletions
109
scripts/cli-first-contract-smoke.js
Normal file
109
scripts/cli-first-contract-smoke.js
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const repo = path.resolve(__dirname, "..");
|
||||
|
||||
function read(relativePath) {
|
||||
const fullPath = path.join(repo, relativePath);
|
||||
if (!fs.existsSync(fullPath)) {
|
||||
if (fs.existsSync(path.join(repo, "DISASMER_PUBLIC_TREE.json"))) {
|
||||
console.log(
|
||||
`CLI-first contract smoke skipped: ${relativePath} is filtered from this public tree`
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
throw new Error(`${relativePath} is missing`);
|
||||
}
|
||||
return fs.readFileSync(fullPath, "utf8");
|
||||
}
|
||||
|
||||
function criterionLines(source) {
|
||||
return source
|
||||
.split(/\r?\n/)
|
||||
.filter((line) => /^- \[[ x]\] \*\*/.test(line));
|
||||
}
|
||||
|
||||
function expect(source, name, pattern) {
|
||||
assert.match(source, pattern, `missing CLI-first contract evidence: ${name}`);
|
||||
}
|
||||
|
||||
const criteria = read("cli_acceptance_criteria.md");
|
||||
const cli = read("crates/disasmer-cli/src/main.rs");
|
||||
|
||||
expect(criteria, "header", /^# Disasmer CLI-First MVP Acceptance Criteria/m);
|
||||
expect(
|
||||
criteria,
|
||||
"addendum status",
|
||||
/\*\*Status:\*\* CLI-first addendum to `acceptance_criteria\.md` and `acceptance_criteria_phase2\.md`/
|
||||
);
|
||||
expect(
|
||||
criteria,
|
||||
"website exception",
|
||||
/hosted account creation as the only intentional private website exception/
|
||||
);
|
||||
expect(
|
||||
criteria,
|
||||
"no duplicate work note",
|
||||
/does not automatically mean new product code, a new feature, or even actual implementation work is required/
|
||||
);
|
||||
expect(
|
||||
criteria,
|
||||
"future hosted business non-goal",
|
||||
/billing, full support tooling, broad moderation consoles, and durable account\/business-process management are intentionally outside this CLI-first MVP slice/
|
||||
);
|
||||
|
||||
const lines = criterionLines(criteria);
|
||||
assert(lines.length > 0, "CLI-first criteria must contain criteria lines");
|
||||
for (const line of lines) {
|
||||
assert.match(
|
||||
line,
|
||||
/^- \[[ x]\] \*\*(Passed|Partial|Open)(?: \([^)]+\))?:\*\*/,
|
||||
`CLI-first criterion lacks an explicit status prefix: ${line}`
|
||||
);
|
||||
}
|
||||
|
||||
const openCriteria = lines.filter((line) => /\*\*Open(?::| \()/.test(line));
|
||||
assert.deepStrictEqual(
|
||||
openCriteria,
|
||||
[
|
||||
"- [ ] **Open:** Every criterion in this document is validated end-to-end or with integration-style coverage, preferably against a realistic NixOS deployment that can pretend to be live hosted infrastructure.",
|
||||
],
|
||||
"only the full CLI-first verification gate should remain Open while command/API facts are Partial"
|
||||
);
|
||||
|
||||
for (const [name, pattern] of [
|
||||
["top-level version metadata", /#\[command\(name = "disasmer", version, arg_required_else_help = true\)\]/],
|
||||
["doctor command", /Doctor\(DoctorArgs\)/],
|
||||
["auth status command", /enum AuthCommands[\s\S]*Status\(AuthStatusArgs\)/],
|
||||
["auth logout command", /enum AuthCommands[\s\S]*Logout\(AuthLogoutArgs\)/],
|
||||
["key lifecycle commands", /enum KeyCommands[\s\S]*Add\(KeyAddArgs\)[\s\S]*List\(KeyListArgs\)[\s\S]*Revoke\(KeyRevokeArgs\)/],
|
||||
["project commands", /enum ProjectCommands[\s\S]*Init\(ProjectInitArgs\)[\s\S]*Status\(ProjectStatusArgs\)[\s\S]*List\(ProjectListArgs\)[\s\S]*Select\(ProjectSelectArgs\)/],
|
||||
["inspect command", /Inspect\(BundleInspectArgs\)/],
|
||||
["build command", /Build\(BuildArgs\)/],
|
||||
["node lifecycle commands", /enum NodeCommands[\s\S]*Attach\(AttachArgs\)[\s\S]*Enroll\(NodeEnrollArgs\)[\s\S]*List\(NodeListArgs\)[\s\S]*Status\(NodeStatusArgs\)[\s\S]*Revoke\(NodeRevokeArgs\)/],
|
||||
["process commands", /enum ProcessCommands[\s\S]*Status\(ProcessStatusArgs\)[\s\S]*Restart\(ProcessRestartArgs\)[\s\S]*Cancel\(ProcessCancelArgs\)/],
|
||||
["task list command", /enum TaskCommands[\s\S]*List\(TaskListArgs\)/],
|
||||
["logs command", /Logs\(LogsArgs\)/],
|
||||
["artifact commands", /enum ArtifactCommands[\s\S]*List\(ArtifactListArgs\)[\s\S]*Download\(ArtifactDownloadArgs\)[\s\S]*Export\(ArtifactExportArgs\)/],
|
||||
["DAP command", /Dap\(DapArgs\)/],
|
||||
["debug attach command", /enum DebugCommands[\s\S]*Attach\(DebugAttachArgs\)/],
|
||||
["quota command", /enum QuotaCommands[\s\S]*Status\(QuotaStatusArgs\)/],
|
||||
["admin commands", /enum AdminCommands[\s\S]*Status\(AdminStatusArgs\)[\s\S]*Bootstrap\(AdminBootstrapArgs\)[\s\S]*RevokeNode\(NodeRevokeArgs\)[\s\S]*StopProcess\(ProcessCancelArgs\)[\s\S]*SuspendTenant\(AdminSuspendTenantArgs\)/],
|
||||
]) {
|
||||
expect(cli, name, pattern);
|
||||
}
|
||||
|
||||
for (const [name, pattern] of [
|
||||
["CLI parse coverage", /fn cli_first_mvp_command_surface_parses\(\)/],
|
||||
["CLI version coverage", /fn top_level_version_is_available\(\)/],
|
||||
["project local config coverage", /fn project_init_select_and_status_use_local_project_config\(\)/],
|
||||
["build no full repo upload coverage", /fn build_command_reuses_bundle_inspection_without_full_repo_upload\(\)/],
|
||||
["safe coordinator-required plans", /fn node_enroll_and_process_commands_have_safe_plan_without_coordinator\(\)/],
|
||||
]) {
|
||||
expect(cli, name, pattern);
|
||||
}
|
||||
|
||||
console.log("CLI-first contract smoke passed");
|
||||
93
scripts/website-inventory-contract-smoke.js
Normal file
93
scripts/website-inventory-contract-smoke.js
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const assert = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const repo = path.resolve(__dirname, "..");
|
||||
const inventoryPath = path.join(repo, "website_mvp_inventory.md");
|
||||
if (!fs.existsSync(inventoryPath)) {
|
||||
if (fs.existsSync(path.join(repo, "DISASMER_PUBLIC_TREE.json"))) {
|
||||
console.log(
|
||||
"Website inventory contract smoke skipped: website_mvp_inventory.md is filtered from this public tree"
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
throw new Error("website_mvp_inventory.md is missing");
|
||||
}
|
||||
const source = fs.readFileSync(inventoryPath, "utf8");
|
||||
|
||||
function expect(name, pattern) {
|
||||
assert.match(source, pattern, `missing website inventory evidence: ${name}`);
|
||||
}
|
||||
|
||||
function criterionLines() {
|
||||
return source
|
||||
.split(/\r?\n/)
|
||||
.filter((line) => /^- \[[ x]\] \*\*/.test(line));
|
||||
}
|
||||
|
||||
expect("header", /^# Disasmer Minimal Website Inventory/m);
|
||||
expect(
|
||||
"acceptance-style status",
|
||||
/\*\*Status:\*\* working MVP website inventory aligned with `acceptance_criteria\.md`, `acceptance_criteria_phase2\.md`, and `cli_acceptance_criteria\.md`/
|
||||
);
|
||||
expect(
|
||||
"hosted signup exception",
|
||||
/except hosted Authentik account creation/
|
||||
);
|
||||
expect(
|
||||
"no duplicate work note",
|
||||
/does not automatically mean new product code, a new feature, or even actual implementation work is required/
|
||||
);
|
||||
expect(
|
||||
"barebones no CSS",
|
||||
/barebones functional HTML with no CSS/
|
||||
);
|
||||
expect(
|
||||
"future hosted business scope",
|
||||
/Billing, checkout, hosted support tooling, a full hosted admin console, broad moderation workflows/
|
||||
);
|
||||
expect(
|
||||
"billing is not MVP website work",
|
||||
/Do not build billing\/upgrade flows into the minimal website for this MVP/
|
||||
);
|
||||
assert.doesNotMatch(source, /community-tier/, "use `community tier`, not `community-tier`");
|
||||
|
||||
const lines = criterionLines();
|
||||
assert(lines.length > 0, "website inventory must contain status-prefixed checklist items");
|
||||
for (const line of lines) {
|
||||
assert.match(
|
||||
line,
|
||||
/^- \[[ x]\] \*\*(Passed|Partial|Open)(?: \([^)]+\))?:\*\*/,
|
||||
`website inventory item lacks an explicit status prefix: ${line}`
|
||||
);
|
||||
}
|
||||
|
||||
for (const [name, pattern] of [
|
||||
["CLI login command", /`disasmer login \[--browser\] \[--coordinator <url>\]`/],
|
||||
["CLI auth status command", /`disasmer auth status`/],
|
||||
["CLI key command", /`disasmer key add --public-key <pubkey>`/],
|
||||
["CLI project init command", /`disasmer project init`/],
|
||||
["CLI node enroll command", /`disasmer node enroll --coordinator <url> --ttl-seconds <seconds>`/],
|
||||
["CLI process status command", /`disasmer process status`/],
|
||||
["CLI task list command", /`disasmer task list`/],
|
||||
["CLI DAP command", /`disasmer dap`/],
|
||||
["CLI quota command", /`disasmer quota status`/],
|
||||
["CLI admin status command", /`disasmer admin status`/],
|
||||
]) {
|
||||
expect(name, pattern);
|
||||
}
|
||||
|
||||
for (const [name, pattern] of [
|
||||
["website default project is open", /- \[ \] \*\*Open:\*\* land in their default project\./],
|
||||
["website node attach is open", /- \[ \] \*\*Open:\*\* copy a node attach command\./],
|
||||
["website process view is open", /- \[ \] \*\*Open:\*\* see the single current virtual process\./],
|
||||
["website logs are open", /- \[ \] \*\*Open:\*\* see recent bounded logs\./],
|
||||
["website artifact download is open", /- \[ \] \*\*Open:\*\* securely download an available best-effort retained artifact\./],
|
||||
["website keys are partial through CLI", /- \[ \] \*\*Partial:\*\* manage\/revoke public keys or know the CLI command to do so\./],
|
||||
]) {
|
||||
expect(name, pattern);
|
||||
}
|
||||
|
||||
console.log("Website inventory contract smoke passed");
|
||||
Loading…
Add table
Add a link
Reference in a new issue