Skip to content

17 · install-half-archon-dir

What this scenario proves

The install guard checks only one file to decide if Archon is already present:

js
if (await pathExists(path.join(targetDir, '.archon', 'soul.md'))) { ... }

So if the target has a .archon/ directory without a soul.md inside (typical of a half-aborted earlier install, a manually-created empty governance directory, or a corrupted state), archon install will treat the project as a clean target and proceed.

This scenario locks that behaviour down so it does not silently change. It is intentionally documented as a sharp edge (see Known limitations) and pairs with the install-matrix discussion of guard semantics.

Test environment

Fixturefixtures/sandbox-node-ts + injected half-archon
IDECursor
Manifest version under testv0.1.x

Pre-conditions

  1. Fixture copied — runner-managed.
  2. No .archon/soul.md exists.
  3. .archon/sentinel.txt injected as prerequisite (so .archon/as a directory already exists).

Steps

text
1. Inject `.archon/sentinel.txt` with a marker line.
2. Run `archon install --with=cli`.
3. Observe install proceeds without complaint.

Expected outcome

CheckExpected
Step 2 exit code0
.archon/soul.mdcreated (the install was not blocked)
.archon/sentinel.txtpreserved (not deleted by install)
.archon/drift.md install rowsexactly 1
.archon-backup-*absent (no --force was needed because the guard didn't fire)

Demo recordings

Will be replaced by docs/public/videos/install-half-archon-dir.mp4 once recorded. See videos/README for upload conventions.
Will be replaced by docs/public/asciinema/install-half-archon-dir.cast embedded via the asciinema-player web component. See asciinema/README for the recording command.

Run records

bash
node scripts/sandbox-run.mjs --only=install-half-archon-dir
Started (UTC)ManifestRunnerResultDurationNotesRecord
2026-06-08 08:17:12 UTCv0.1.0cli✅ passing317 msJSON
2026-06-07 07:10:17 UTCv0.1.0cli✅ passing321 msJSON
2026-06-06 06:34:41 UTCv0.1.0cli✅ passing334 msJSON
2026-06-05 07:14:07 UTCv0.1.0cli✅ passing306 msJSON
2026-06-04 07:56:44 UTCv0.1.0cli✅ passing323 msJSON
2026-06-03 08:24:18 UTCv0.1.0cli✅ passing343 msJSON
2026-06-02 08:00:52 UTCv0.1.0cli✅ passing341 msJSON
2026-06-01 08:40:46 UTCv0.1.0cli✅ passing338 msJSON
2026-05-31 07:02:24 UTCv0.1.0cli✅ passing332 msJSON
2026-05-30 06:27:53 UTCv0.1.0cli✅ passing317 msJSON
2026-05-29 06:59:40 UTCv0.1.0cli✅ passing324 msJSON
2026-05-28 06:59:33 UTCv0.1.0cli✅ passing312 msJSON
2026-05-27 07:09:42 UTCv0.1.0cli✅ passing317 msJSON
2026-05-26 06:52:09 UTCv0.1.0cli✅ passing291 msJSON
2026-05-25 07:20:22 UTCv0.1.0cli✅ passing322 msJSON
2026-05-24 06:41:53 UTCv0.1.0cli✅ passing321 msJSON
2026-05-23 06:16:50 UTCv0.1.0cli✅ passing316 msJSON
2026-05-22 06:54:18 UTCv0.1.0cli✅ passing319 msJSON
2026-05-21 06:58:04 UTCv0.1.0cli✅ passing328 msJSON
2026-05-20 06:53:38 UTCv0.1.0cli✅ passing318 msJSON
2026-05-19 06:53:18 UTCv0.1.0cli✅ passing316 msJSON
2026-05-18 07:01:47 UTCv0.1.0cli✅ passing338 msJSON
2026-05-17 06:27:36 UTCv0.1.0cli✅ passing325 msJSON
2026-05-16 06:04:40 UTCv0.1.0cli✅ passing317 msJSON
2026-05-15 06:37:59 UTCv0.1.0cli✅ passing327 msJSON
2026-05-14 06:28:57 UTCv0.1.0cli✅ passing325 msJSON
2026-05-13 06:30:25 UTCv0.1.0cli✅ passing298 msJSON
2026-05-12 06:19:01 UTCv0.1.0cli✅ passing322 msJSON
2026-05-11 06:45:35 UTCv0.1.0cli✅ passing303 msJSON
2026-05-10 06:16:45 UTCv0.1.0cli✅ passing351 msJSON
2026-05-09 05:52:39 UTCv0.1.0cli✅ passing292 msJSON
2026-05-08 05:33:36 UTCv0.1.0cli✅ passing341 msJSON
2026-05-07 11:01:03 UTCv0.1.0cli✅ passing305 msJSON
2026-05-07 09:54:54 UTCv0.1.0cli✅ passing326 msJSON
2026-05-07 09:45:13 UTCv0.1.0cli✅ passing489 msJSON
2026-05-07 06:15:45 UTCv0.1.0cli✅ passing252 msJSON
2026-05-06 11:45:37 UTCv0.1.0cli✅ passing288 msJSON
2026-05-06 11:44:06 UTCv0.1.0cli✅ passing293 msJSON
2026-05-06 11:19:26 UTCv0.1.0cli✅ passing627 msJSON

Known limitations

  • This is a documented sharp edge, not a bug fix in disguise. The install guard is intentionally narrow (soul.md is the canonical "Archon was here" marker; bare .archon/ directories are common during scaffolding). If the team ever decides the guard should also fire on a non-empty .archon/, this scenario must flip its expectations.
  • Does not check what happens if .archon/manifest.md exists but soul.md does not — that is a more subtle half-state worth a follow-up scenario.

Cross-references

json
{
  "runnable": "cli",
  "fixture": "fixtures/sandbox-node-ts",
  "ide_platform": "cursor",
  "prerequisites": [
    {
      "name": "drop sandbox check helper",
      "write_file": {
        "path": "__sb-check.cjs",
        "content": "const fs=require('fs');const op=process.argv[2];const args=process.argv.slice(3);if(op==='drift-install-count'){const want=Number(args[0]);const c=fs.readFileSync('.archon/drift.md','utf8');const m=c.match(/^## install /gm);const n=m?m.length:0;if(n!==want){console.error('drift install rows: want',want,'got',n);process.exit(1)}process.exit(0)}if(op==='no-backup-dir'){const found=fs.readdirSync('.').some(function(x){return x.indexOf('.archon-backup-')===0});if(found){console.error('unexpected .archon-backup-*');process.exit(1)}process.exit(0)}if(op==='has-backup-dir'){const found=fs.readdirSync('.').some(function(x){return x.indexOf('.archon-backup-')===0});if(!found){console.error('expected .archon-backup-* missing');process.exit(1)}process.exit(0)}if(op==='pkg-name-equals'){const p=require('./package.json');if(p.name!==args[0]){console.error('package.json name mutated:',p.name);process.exit(1)}process.exit(0)}if(op==='file-includes'){const text=fs.readFileSync(args[0],'utf8');if(text.indexOf(args[1])===-1){console.error(args[0],'missing',args[1]);process.exit(1)}process.exit(0)}if(op==='drift-modules-excludes'){const c=fs.readFileSync('.archon/drift.md','utf8');const re=new RegExp('^- Modules:.*\\\\b'+args[0]+'\\\\b','m');if(re.test(c)){console.error(args[0],'unexpectedly listed');process.exit(1)}process.exit(0)}console.error('unknown op:',op);process.exit(2);\n"
      }
    },
    {
      "name": "inject .archon/sentinel.txt (no soul.md)",
      "write_file": {
        "path": ".archon/sentinel.txt",
        "content": "half-archon sentinel for scenario 17\n"
      }
    }
  ],
  "steps": [
    {
      "name": "archon install --with=cli",
      "cli": "install",
      "flags": ["--with=cli"]
    }
  ],
  "assertions": [
    { "file_exists": ".archon/soul.md" },
    { "file_exists": ".archon/sentinel.txt" },
    { "file_contains": { "path": ".archon/sentinel.txt", "substr": "half-archon sentinel" } },
    { "cmd_zero": ["node", "__sb-check.cjs", "drift-install-count", "1"] },
    { "cmd_zero": ["node", "__sb-check.cjs", "no-backup-dir"] },
    { "cmd_zero": ["python3", "scripts/archon-check.py", "--root", "."] }
  ],
  "notes": "Documents the install guard's narrow check (soul.md only). A bare .archon/ does not block install."
}

Released under the Apache-2.0 License.