Skip to content

Commit 8c45cab

Browse files
hyperpolymathclaude
andcommitted
feat: adopt contractile system for Physical State, Trust, Dust, and Intent
Scaffolded via `contractile init`, then tailored: - Mustfile.a2ml: 9 checks (license, readme, security.md, justfile, package.json, no banned files, no env files, SPDX headers, MCP bridge) - Trustfile.a2ml: starter integrity verifications - Dustfile.a2ml: source rollback with precondition - Intentfile.a2ml: 7 intents tracking cartridges, cloud integrations, comms integrations, ABI/FFI, ReScript migration, tests, CI - contractile.just: 15 auto-generated recipes, imported in Justfile Run `contractile status` to see project health at a glance. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d7e64b0 commit 8c45cab

6 files changed

Lines changed: 267 additions & 0 deletions

File tree

Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ set shell := ["bash", "-uc"]
1414
set dotenv-load := true
1515
set positional-arguments := true
1616

17+
# Import auto-generated contractile recipes (must-check, trust-verify, etc.)
18+
import? "contractile.just"
19+
1720
# Project metadata — customize these
1821
project := "Bundle of Joy Server"
1922
version := "0.1.0"

contractile.just

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Auto-generated by: contractile gen-just
2+
# Source directory: contractiles
3+
# Re-generate with: contractile gen-just --dir contractiles
4+
#
5+
# SPDX-License-Identifier: PMPL-1.0-or-later
6+
7+
# === DUST (Recovery & Rollback) ===
8+
# Source: Dustfile.a2ml
9+
10+
# List available dust recovery actions
11+
dust-status:
12+
@echo ' dust-source-rollback: Revert all source changes to last commit [rollback]'
13+
14+
# Revert all source changes to last commit
15+
dust-source-rollback:
16+
@echo 'Executing rollback for source-rollback'
17+
git checkout HEAD -- .
18+
19+
20+
# === INTEND (Declared Future Intent) ===
21+
# Source: Intentfile.a2ml
22+
23+
# Display declared future intents
24+
intend-list:
25+
@echo '=== Declared Intent ==='
26+
@echo ''
27+
@echo 'Features:'
28+
@echo ''
29+
@echo 'Integrations:'
30+
@echo ''
31+
@echo 'Quality:'
32+
33+
34+
# === MUST (Physical State Checks) ===
35+
# Source: Mustfile.a2ml
36+
37+
# Run all must checks
38+
must-check: must-license-present must-readme-present must-security-md-present must-justfile-present must-package-json-present must-no-banned-files must-no-env-files must-spdx-headers must-mcp-bridge-exists
39+
@echo 'All must checks passed'
40+
41+
# LICENSE file must exist
42+
must-license-present:
43+
test -f LICENSE
44+
45+
# README must exist
46+
must-readme-present:
47+
test -f README.adoc || test -f README.md
48+
49+
# SECURITY.md must exist
50+
must-security-md-present:
51+
test -f SECURITY.md
52+
53+
# Justfile must exist
54+
must-justfile-present:
55+
test -f Justfile
56+
57+
# package.json must exist (MCP server entry point)
58+
must-package-json-present:
59+
test -f package.json
60+
61+
# No Dockerfiles or Makefiles
62+
must-no-banned-files:
63+
test ! -f Dockerfile && test ! -f Makefile
64+
65+
# No .env files committed
66+
must-no-env-files:
67+
test ! -f .env && test ! -f .env.local
68+
69+
# JS source files should have SPDX headers
70+
must-spdx-headers:
71+
find . -name '*.js' -not -path '*/node_modules/*' | head -20 | xargs -r grep -L 'SPDX-License-Identifier' | wc -l | grep -q '^0$'
72+
73+
# MCP bridge entry point must exist
74+
must-mcp-bridge-exists:
75+
test -f mcp-bridge/main.js
76+
77+
78+
# === TRUST (Integrity & Provenance Verification) ===
79+
# Source: Trustfile.a2ml
80+
81+
# Run all trust verifications
82+
trust-verify: trust-license-content trust-no-secrets-committed trust-container-images-pinned
83+
@echo 'All trust verifications passed'
84+
85+
# LICENSE contains expected SPDX identifier
86+
trust-license-content:
87+
grep -q 'SPDX\|License\|MIT\|Apache\|PMPL\|MPL' LICENSE
88+
89+
# No .env or credential files in repo
90+
trust-no-secrets-committed:
91+
test ! -f .env && test ! -f credentials.json && test ! -f .env.local
92+
93+
# Containerfile base images use pinned digests
94+
trust-container-images-pinned:
95+
test ! -f Containerfile || grep -q '@sha256:' Containerfile
96+
97+

contractiles/dust/Dustfile.a2ml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Dustfile (A2ML Canonical)
3+
4+
@abstract:
5+
Recovery and rollback paths for boj-server.
6+
Declares how to undo significant state changes.
7+
@end
8+
9+
@requires:
10+
- section: Source
11+
@end
12+
13+
## Source
14+
15+
### source-rollback
16+
- description: Revert all source changes to last commit
17+
- rollback: git checkout HEAD -- .
18+
- blast_radius: file
19+
- precondition: git stash
20+
- notes: Stashes uncommitted work before reverting

contractiles/lust/Intentfile.a2ml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Intentfile (A2ML Canonical)
3+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
4+
5+
@abstract:
6+
Declared future intent for boj-server — MCP server for Butler of Joy.
7+
Tracks features, integrations, and quality goals.
8+
@end
9+
10+
@requires:
11+
- section: Features
12+
- section: Integrations
13+
- section: Quality
14+
@end
15+
16+
## Features
17+
18+
### cartridge-system
19+
- description: Complete cartridge-based extensibility system
20+
- status: in-progress
21+
- priority: critical
22+
- evidence: command: grep -q 'cartridge' package.json
23+
24+
### cloud-integrations
25+
- description: Cloudflare, Vercel, and Verpex cloud management
26+
- status: in-progress
27+
- priority: high
28+
- evidence: command: grep -q 'cloudflare' package.json
29+
30+
### comms-integrations
31+
- description: Gmail and Calendar communication tools
32+
- status: in-progress
33+
- priority: high
34+
- evidence: command: grep -q 'gmail' package.json
35+
36+
## Integrations
37+
38+
### abi-ffi-layer
39+
- description: Add Idris2 ABI / Zig FFI layer
40+
- status: declared
41+
- priority: medium
42+
- evidence: src/abi/ exists
43+
44+
### rescript-migration
45+
- description: Migrate JS to ReScript where applicable
46+
- status: declared
47+
- priority: medium
48+
- evidence: command: find . -name '*.res' | wc -l | grep -v '^0$'
49+
50+
## Quality
51+
52+
### test-coverage
53+
- description: Achieve meaningful test coverage
54+
- status: declared
55+
- priority: medium
56+
57+
### contractile-ci
58+
- description: Run contractile checks in CI pipeline
59+
- status: declared
60+
- priority: high
61+
- evidence: command: grep -q 'contractile' .github/workflows/*.yml 2>/dev/null

contractiles/must/Mustfile.a2ml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Mustfile (A2ML Canonical)
3+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
4+
5+
@abstract:
6+
Physical State contract for boj-server — MCP server for Butler of Joy.
7+
Ensures required files exist, no banned patterns, and SPDX compliance.
8+
@end
9+
10+
@requires:
11+
- section: Checks
12+
@end
13+
14+
## Checks
15+
16+
### license-present
17+
- description: LICENSE file must exist
18+
- run: test -f LICENSE
19+
- severity: critical
20+
21+
### readme-present
22+
- description: README must exist
23+
- run: test -f README.adoc || test -f README.md
24+
- severity: critical
25+
26+
### security-md-present
27+
- description: SECURITY.md must exist
28+
- run: test -f SECURITY.md
29+
- severity: critical
30+
31+
### justfile-present
32+
- description: Justfile must exist
33+
- run: test -f Justfile
34+
- severity: critical
35+
36+
### package-json-present
37+
- description: package.json must exist (MCP server entry point)
38+
- run: test -f package.json
39+
- severity: critical
40+
41+
### no-banned-files
42+
- description: No Dockerfiles or Makefiles
43+
- run: test ! -f Dockerfile && test ! -f Makefile
44+
- severity: critical
45+
46+
### no-env-files
47+
- description: No .env files committed
48+
- run: test ! -f .env && test ! -f .env.local
49+
- severity: critical
50+
51+
### spdx-headers
52+
- description: JS source files should have SPDX headers
53+
- run: find . -name '*.js' -not -path '*/node_modules/*' | head -20 | xargs -r grep -L 'SPDX-License-Identifier' | wc -l | grep -q '^0$'
54+
- severity: warning
55+
56+
### mcp-bridge-exists
57+
- description: MCP bridge entry point must exist
58+
- run: test -f mcp-bridge/main.js
59+
- severity: critical

contractiles/trust/Trustfile.a2ml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Trustfile (A2ML Canonical)
3+
4+
@abstract:
5+
Integrity and provenance verification for boj-server.
6+
@end
7+
8+
@requires:
9+
- section: Verifications
10+
@end
11+
12+
## Verifications
13+
14+
### license-content
15+
- description: LICENSE contains expected SPDX identifier
16+
- command: grep -q 'SPDX\|License\|MIT\|Apache\|PMPL\|MPL' LICENSE
17+
- severity: warning
18+
19+
### no-secrets-committed
20+
- description: No .env or credential files in repo
21+
- command: test ! -f .env && test ! -f credentials.json && test ! -f .env.local
22+
- severity: critical
23+
24+
### container-images-pinned
25+
- description: Containerfile base images use pinned digests
26+
- command: test ! -f Containerfile || grep -q '@sha256:' Containerfile
27+
- severity: warning

0 commit comments

Comments
 (0)