Skip to content

Commit 995ee8a

Browse files
feat: add machine-readable anchor and spec files (#34)
Add .machine_read/ directory with Scheme-based machine-readable metadata for LLM assistants and downstream tooling: - ANCHOR.wokelang.scm: Authoritative upstream anchor defining this repo as the canonical source for WokeLang semantics and grammar - LLM_SUPERINTENDENT.scm: Guidance for AI assistants working on the codebase, including scope boundaries and contribution rules - ROADMAP.f0.scm: Machine-readable roadmap with milestones - SPEC.core.scm: Core language specification contract defining consent, gratitude, emote, and units system semantics - AUTHORITY_STACK.mustfile-nickel.scm: Task routing and config authority definitions (just/must/nickel stack) This enables downstream repos (wokelang-playground, wokelang-vscode, wokelang-lsp) to properly inherit upstream authority. Co-authored-by: Claude <noreply@anthropic.com>
1 parent b2e61ea commit 995ee8a

5 files changed

Lines changed: 541 additions & 0 deletions

File tree

.machine_read/ANCHOR.wokelang.scm

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
;; SPDX-License-Identifier: AGPL-3.0-or-later
2+
;; SPDX-FileCopyrightText: 2026 Hyperpolymath
3+
;;
4+
;; Machine-readable anchor for WokeLang
5+
;; Schema: hyperpolymath.anchor/1
6+
7+
(define anchor
8+
'((schema . "hyperpolymath.anchor/1")
9+
(repo . "hyperpolymath/wokelang")
10+
(date . "2026-01-01")
11+
(authority . "repo-superintendent")
12+
(purpose
13+
. ("Authoritative source for WokeLang language specification."
14+
"Human-centered programming language: empathy, consent, and gratitude as first-class concepts."
15+
"All downstream implementations defer to this repo for semantics and grammar."))
16+
17+
(identity
18+
. ((project . "WokeLang")
19+
(kind . "language-core")
20+
(one-sentence . "A human-centered programming language with empathy, consent, and gratitude.")
21+
(upstream . #f))) ; This IS the upstream
22+
23+
(semantic-anchor
24+
. ((policy . "authoritative")
25+
(downstream-repos
26+
. ("hyperpolymath/wokelang-playground"
27+
"hyperpolymath/wokelang-vscode"
28+
"hyperpolymath/wokelang-lsp"))
29+
(authority-scope
30+
. ("EBNF grammar specification (docs/grammar.ebnf)"
31+
"Language semantics and type system"
32+
"Compiler implementation (src/)"
33+
"Standard library definitions"
34+
"Consent system semantics"
35+
"Gratitude block semantics"
36+
"Emote tag semantics"))))
37+
38+
(implementation-policy
39+
. ((allowed . ("Rust" "OCaml" "Scheme" "Shell" "Just" "Markdown" "AsciiDoc" "Lean" "Coq"))
40+
(primary . ("Rust" "OCaml"))
41+
(quarantined . ("JavaScript without ReScript" "TypeScript"))
42+
(forbidden
43+
. ("Competing language specification"
44+
"Breaking semantic changes without RFC"
45+
"Removal of consent gates"
46+
"Removal of gratitude blocks"))))
47+
48+
(golden-path
49+
. ((smoke-test-command
50+
. ("cargo test"
51+
"cargo run -- examples/hello.woke"
52+
"cargo run -- repl"))
53+
(success-criteria
54+
. ("All core tests pass."
55+
"REPL evaluates basic expressions."
56+
"Example programs run without error."
57+
"WASM compilation produces valid modules."))))
58+
59+
(mandatory-files
60+
. ("./.machine_read/LLM_SUPERINTENDENT.scm"
61+
"./.machine_read/ROADMAP.f0.scm"
62+
"./.machine_read/SPEC.core.scm"
63+
"./.machine_read/AUTHORITY_STACK.mustfile-nickel.scm"))
64+
65+
(first-pass-directives
66+
. ("Ensure grammar.ebnf is canonical."
67+
"Verify all semantic constructs documented in proofs/."
68+
"Validate consent/gratitude/emote semantics are formally specified."))
69+
70+
(rsr . ((target-tier . "silver-now")
71+
(current-achievements
72+
. ("EBNF grammar specification"
73+
"Tree-walking interpreter"
74+
"WASM compilation"
75+
"Formal proofs (Lean, Coq)"
76+
"Security validation hooks"))
77+
(upgrade-path . "gold-after-v0.3 (full type system + native compilation)")))))
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
;; SPDX-License-Identifier: AGPL-3.0-or-later
2+
;; SPDX-FileCopyrightText: 2026 Hyperpolymath
3+
;;
4+
;; AUTHORITY_STACK.mustfile-nickel.scm
5+
;; Shared drop for hyperpolymath repos: defines task routing + config authority.
6+
7+
(define authority-stack
8+
'((schema . "hyperpolymath.authority-stack/1")
9+
(intent
10+
. ("Stop agentic drift and toolchain creep."
11+
"Make the repo executable via a single blessed interface."
12+
"Prevent the LLM from inventing commands, tools, or files."))
13+
14+
(operational-authority
15+
. ((local-tasks . "just")
16+
(deployment-transitions . "must")
17+
(config-manifests . "nickel")
18+
(container-engine . "podman-first")))
19+
20+
(hard-rules
21+
. ("Makefiles are forbidden."
22+
"All operations must be invoked via `just <recipe>` (local) or `must <transition>` (deployment)."
23+
"If a recipe/transition does not exist, the correct action is to ADD it (and document it), not to run ad-hoc commands."
24+
"Nickel manifests are the single source of truth for config; do not hand-edit generated outputs."
25+
"No network-required runtime paths for demos/tests unless explicitly permitted in ANCHOR."))
26+
27+
(workflow
28+
. ((first-run
29+
. ("Read ANCHOR*.scm"
30+
"Read STATE.scm"
31+
"Run: just --list"
32+
"Run: just test"
33+
"Run: just demo (if defined)"))
34+
(adding-new-capability
35+
. ("Update SPEC/ROADMAP first"
36+
"Add a `just` recipe (and tests) that implements the capability"
37+
"Only then edit code"))))
38+
39+
(tooling-contract
40+
. ((mustfile-notes
41+
. ("Mustfile is the deployment contract (physical state transitions)."
42+
"must is the supervisor/enforcer for must-spec; it routes through just where appropriate."))
43+
(nickel-notes
44+
. ("Nickel provides validated, type-safe manifests."
45+
"Prefer .ncl for machine-truth; render docs from it via your conversion pipeline."))
46+
(shell-entrypoints
47+
. ("Shell wrappers may exist; all must route to just/must without inventing extra logic."))))))
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
;; SPDX-License-Identifier: AGPL-3.0-or-later
2+
;; SPDX-FileCopyrightText: 2026 Hyperpolymath
3+
;;
4+
;; LLM Superintendent Instructions for WokeLang
5+
;; This file provides guidance for AI assistants working on this codebase.
6+
7+
(define llm-superintendent
8+
'((schema . "hyperpolymath.llm-superintendent/1")
9+
(repo . "hyperpolymath/wokelang")
10+
(last-updated . "2026-01-01")
11+
12+
(identity
13+
. ((project . "WokeLang")
14+
(role . "authoritative-upstream")
15+
(description
16+
. "WokeLang is a human-centered programming language emphasizing empathy, consent, and gratitude. This is the authoritative implementation.")))
17+
18+
(scope-boundaries
19+
. ((in-scope
20+
. ("Language grammar and parsing (src/lexer/, src/parser/)"
21+
"Abstract syntax tree definitions"
22+
"Type system implementation"
23+
"Interpreter and evaluation"
24+
"WASM compilation target"
25+
"Standard library (lib/)"
26+
"FFI bindings (include/, zig/)"
27+
"Formal proofs and verification (docs/proofs/)"
28+
"Documentation and wiki (docs/)"
29+
"Examples (examples/)"
30+
"CI/CD and security workflows (.github/)"))
31+
(out-of-scope
32+
. ("Playground UX (belongs in wokelang-playground)"
33+
"Editor extensions (separate repos)"
34+
"Package registry infrastructure"
35+
"Third-party integrations not covered by FFI"))))
36+
37+
(language-policy
38+
. ((primary-languages . ("Rust" "OCaml"))
39+
(documentation . ("Markdown" "AsciiDoc"))
40+
(proofs . ("Lean" "Coq"))
41+
(config . ("TOML" "Scheme"))
42+
(forbidden . ("TypeScript" "Go" "Python-outside-SaltStack"))))
43+
44+
(semantic-invariants
45+
. ((consent-gates
46+
. "All operations that are 'sensitive' (file I/O, network, env) MUST use consent gates. The 'only if okay' construct is not optional sugar.")
47+
(gratitude-blocks
48+
. "'thanks to' blocks are semantically meaningful and preserved in AST. They are not comments.")
49+
(emote-tags
50+
. "@feeling annotations are part of the type system and affect compilation.")
51+
(units
52+
. "'measured in' provides compile-time unit checking. Unit mismatches are errors, not warnings.")))
53+
54+
(contribution-rules
55+
. ((before-changes
56+
. ("Read docs/grammar.ebnf for syntax decisions"
57+
"Check docs/proofs/ for semantic guarantees"
58+
"Run 'cargo test' to verify baseline"))
59+
(when-changing-grammar
60+
. ("Update docs/grammar.ebnf first"
61+
"Update parser to match"
62+
"Add test cases for new syntax"
63+
"Update formal semantics if applicable"))
64+
(when-adding-features
65+
. ("Consider consent implications"
66+
"Preserve human-centered design philosophy"
67+
"Add documentation alongside code"
68+
"Add example programs demonstrating feature"))))
69+
70+
(critical-files
71+
. (("docs/grammar.ebnf" . "Canonical EBNF grammar - all parsing decisions derive from this")
72+
("src/parser/" . "Parser implementation - must match grammar.ebnf")
73+
("src/vm.rs" . "Virtual machine - core execution semantics")
74+
("docs/proofs/formal-semantics/" . "Formal specifications - semantic truth source")
75+
("docs/proofs/type-theory/" . "Type system proofs")
76+
("examples/" . "Reference programs - used for testing and documentation")))
77+
78+
(testing-requirements
79+
. ((unit-tests . "cargo test")
80+
(examples . "Run all .woke files in examples/")
81+
(proofs . "Lean/Coq proofs in docs/proofs/verification/")))
82+
83+
(security-notes
84+
. ((pre-commit-hooks . "hooks/ contains validation scripts")
85+
(spdx-required . "All source files need SPDX headers")
86+
(sha-pins . "Dependencies must be SHA-pinned")
87+
(no-secrets . "Never commit credentials or API keys")))
88+
89+
(communication-style
90+
. ((error-messages
91+
. "WokeLang error messages are kind and constructive. They explain what went wrong, why it matters, and suggest fixes.")
92+
(documentation
93+
. "Documentation uses welcoming, accessible language. Technical accuracy does not require hostility.")
94+
(code-comments
95+
. "Comments explain intent, not mechanics. 'This ensures user consent before file deletion' not 'deletes file'.")))))

.machine_read/ROADMAP.f0.scm

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
;; SPDX-License-Identifier: AGPL-3.0-or-later
2+
;; SPDX-FileCopyrightText: 2026 Hyperpolymath
3+
;;
4+
;; Machine-readable roadmap for WokeLang
5+
;; f0 = foundation milestone (initial machine-readable spec)
6+
7+
(define roadmap
8+
'((schema . "hyperpolymath.roadmap/1")
9+
(repo . "hyperpolymath/wokelang")
10+
(version . "f0")
11+
(last-updated . "2026-01-01")
12+
13+
(current-milestone
14+
. ((name . "foundation")
15+
(version . "0.1.x")
16+
(status . "complete")
17+
(features
18+
. ((grammar . "complete")
19+
(lexer . "complete")
20+
(parser . "complete")
21+
(ast . "complete")
22+
(interpreter . "complete")
23+
(cli . "complete")
24+
(repl . "complete")
25+
(wasm-basic . "complete")
26+
(c-ffi . "complete")
27+
(zig-ffi . "complete")))))
28+
29+
(milestones
30+
. (((id . "m1")
31+
(name . "language-completeness")
32+
(target . "0.2.0")
33+
(dependencies . ())
34+
(features
35+
. ((static-type-inference . "planned")
36+
(generic-types . "planned")
37+
(union-types . "planned")
38+
(pattern-matching . "planned")
39+
(module-system . "planned")
40+
(result-types . "planned")
41+
(error-propagation . "planned"))))
42+
43+
((id . "m2")
44+
(name . "concurrency-safety")
45+
(target . "0.3.0")
46+
(dependencies . ("m1"))
47+
(features
48+
. ((async-workers . "planned")
49+
(message-passing . "planned")
50+
(worker-pools . "planned")
51+
(side-quests . "planned")
52+
(capability-security . "planned")
53+
(consent-persistence . "planned"))))
54+
55+
((id . "m3")
56+
(name . "standard-library")
57+
(target . "0.4.0")
58+
(dependencies . ("m2"))
59+
(features
60+
. ((std-io . "planned")
61+
(std-net . "planned")
62+
(std-json . "planned")
63+
(std-time . "planned")
64+
(std-math . "planned")
65+
(std-units . "planned")
66+
(consent-aware-modules . "planned"))))
67+
68+
((id . "m4")
69+
(name . "optimizing-compiler")
70+
(target . "0.5.0")
71+
(dependencies . ("m3"))
72+
(features
73+
. ((wasm-full . "planned")
74+
(wasi-integration . "planned")
75+
(llvm-backend . "planned")
76+
(native-binaries . "planned")
77+
(optimizations . "planned"))))
78+
79+
((id . "m5")
80+
(name . "tooling-ecosystem")
81+
(target . "0.6.0-0.7.0")
82+
(dependencies . ("m4"))
83+
(features
84+
. ((vscode-extension . "planned")
85+
(lsp-server . "planned")
86+
(tree-sitter . "planned")
87+
(package-manager . "planned")
88+
(test-framework . "planned")
89+
(doc-generator . "planned"))))
90+
91+
((id . "m6")
92+
(name . "stable-release")
93+
(target . "1.0.0")
94+
(dependencies . ("m5"))
95+
(features
96+
. ((api-stability . "planned")
97+
(semantic-versioning . "planned")
98+
(migration-guides . "planned")
99+
(lts-support . "planned"))))))
100+
101+
(completed-work
102+
. ((grammar
103+
. ((file . "docs/grammar.ebnf")
104+
(status . "canonical")))
105+
(proofs
106+
. ((directory . "docs/proofs/")
107+
(lean . "docs/proofs/verification/WokeLang.lean")
108+
(coq . "docs/proofs/verification/WokeLang.v")
109+
(status . "foundational")))
110+
(examples
111+
. ((directory . "examples/")
112+
(count . 10)
113+
(coverage . "basic-features")))))
114+
115+
(blocking-issues . ())
116+
117+
(downstream-impact
118+
. ((wokelang-playground
119+
. "Depends on stable grammar and error message format")
120+
(wokelang-vscode
121+
. "Depends on LSP implementation (m5)")
122+
(wokelang-lsp
123+
. "Depends on incremental parsing (m5)")))))

0 commit comments

Comments
 (0)