Skip to content

Commit 90f5073

Browse files
hyperpolymathclaude
andcommitted
docs: bespoke documentation for mylangiser progressive-disclosure generator
Replace all template placeholders and generic content with mylangiser-specific documentation covering API surface analysis, complexity scoring, disclosure levels (@beginner/@intermediate/@expert), smart default inference, and layered wrapper generation. Files updated: - README.adoc: full architecture, My-Lang specifics, use cases - ROADMAP.adoc: Phase 0-6 from scaffold through ecosystem - TOPOLOGY.md: module map, data flow, scoring formula, invariants - Idris2 ABI: DisclosureLevel, ComplexityScore, APIEndpoint, LayeredWrapper, SmartDefault types; APISurfaceDescriptor/EndpointDescriptor/WrapperDescriptor layouts; analysis/scoring/generation FFI declarations - Zig FFI: domain-specific Handle with endpoints/wrappers, scoring algorithm, layer generation logic, all tests updated - 0-AI-MANIFEST.a2ml: domain concepts, repo structure, session checklist - .machine_readable/6a2/*: STATE, META, ECOSYSTEM, AGENTIC, NEUROSYM, PLAYBOOK - .machine_readable/anchors/ANCHOR.a2ml: semantic authority for disclosure levels - .machine_readable/ai/AI.a2ml: domain rules and key files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4bede2d commit 90f5073

18 files changed

Lines changed: 1343 additions & 569 deletions

File tree

.machine_readable/6a2/AGENTIC.a2ml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
#
4-
# AGENTIC.a2ml — AI agent constraints and capabilities
4+
# AGENTIC.a2ml — AI agent constraints and capabilities for mylangiser
55
# Defines what AI agents can and cannot do in this repository.
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "{{CURRENT_DATE}}"
9+
last-updated = "2026-03-21"
1010

1111
[agent-permissions]
1212
can-edit-source = true
@@ -22,6 +22,17 @@ can-create-files = true
2222
# - Never use banned languages (TypeScript, Python, Go, etc.)
2323
# - Never place state files in repository root (must be in .machine_readable/)
2424
# - Never use AGPL license (use PMPL-1.0-or-later)
25+
# - Never break disclosure-level ordering (@beginner < @intermediate < @expert)
26+
# - Never generate smart defaults that violate type constraints
27+
# - Never remove existing Idris2 proofs without replacement
28+
29+
[domain-constraints]
30+
# mylangiser-specific rules:
31+
# - DisclosureLevel ordering is invariant: Beginner < Intermediate < Expert
32+
# - ComplexityScore is bounded 0-100; never exceed
33+
# - Layered wrappers must have monotonically non-decreasing parameter counts
34+
# - Smart defaults must be provably type-safe (Idris2 proof required)
35+
# - API surface analysis must be deterministic and reproducible
2536

2637
[maintenance-integrity]
2738
fail-closed = true

.machine_readable/6a2/ECOSYSTEM.a2ml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
(version "0.1.0")
77
(name "mylangiser")
88
(type "tool")
9-
(purpose "Generate progressive-disclosure interfaces via My-Lang")
9+
(purpose "Analyse complex API surfaces and generate progressive-disclosure wrappers with @beginner/@intermediate/@expert levels via My-Lang")
1010

1111
(position-in-ecosystem
1212
(family "-iser acceleration frameworks")
1313
(meta-framework "iseriser")
1414
(relationship "sibling")
15-
(top-3 ("typedqliser" "chapeliser" "verisimiser")))
15+
(top-3 ("typedqliser" "chapeliser" "verisimiser"))
16+
(unique-value "Only -iser focused on API usability and progressive disclosure; all others target specific compute domains"))
1617

1718
(related-projects
1819
(project "iseriser"
@@ -32,7 +33,10 @@
3233
(description "Database recovery via constraint propagation"))
3334
(project "proven"
3435
(relationship "dependency")
35-
(description "Shared Idris2 verified library"))
36+
(description "Shared Idris2 verified library — may share disclosure-level proofs"))
3637
(project "typell"
3738
(relationship "dependency")
38-
(description "Type theory engine"))))
39+
(description "Type theory engine — complexity scoring may leverage type analysis"))
40+
(project "nextgen-languages"
41+
(relationship "upstream")
42+
(description "My-Lang language definition lives here; mylangiser consumes its spec"))))

.machine_readable/6a2/META.a2ml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,52 @@
44

55
(meta
66
(version "0.1.0")
7-
(last-updated "2026-03-20")
7+
(last-updated "2026-03-21")
88

99
(architecture-decisions
10-
(adr "001-iser-pattern"
10+
(adr "001-progressive-disclosure"
1111
(status "accepted")
12-
(context "Need to make powerful languages accessible without steep learning curves")
13-
(decision "Use manifest-driven code generation: user describes WHAT, tool generates HOW")
14-
(consequences "Users write zero target language code; all complexity in the -iser"))
12+
(context "Complex APIs have steep learning curves; users must learn everything before they can do anything")
13+
(decision "Generate three disclosure tiers (@beginner, @intermediate, @expert) where each is a strict superset of the previous")
14+
(consequences "Users start simple, grow into power features; layer correctness verified by Idris2 proofs"))
1515

16-
(adr "002-abi-ffi-standard"
16+
(adr "002-complexity-scoring"
1717
(status "accepted")
18-
(context "Need verified interop between Rust CLI, target language, and user code")
19-
(decision "Idris2 ABI for formal proofs, Zig FFI for C-ABI bridge")
18+
(context "Need an automated way to decide which endpoints belong at which disclosure level")
19+
(decision "Compute a cognitive-load score (0-100) per endpoint based on parameter count, type depth, and error surface")
20+
(consequences "Deterministic, reproducible tier assignment; configurable thresholds in mylangiser.toml"))
21+
22+
(adr "003-smart-defaults"
23+
(status "accepted")
24+
(context "@beginner wrappers need fewer parameters, so hidden parameters need safe values")
25+
(decision "Infer defaults from type constraints (enum first variant, numeric lower bound), API docs, or user overrides")
26+
(consequences "Beginner code works out of the box; defaults are provably type-safe via Idris2"))
27+
28+
(adr "004-abi-ffi-standard"
29+
(status "accepted")
30+
(context "Need verified interop between Rust CLI, Zig runtime, and generated My-Lang code")
31+
(decision "Idris2 ABI for formal proofs (DisclosureLevel, ComplexityScore, LayeredWrapper), Zig FFI for C-ABI bridge")
2032
(consequences "Compile-time correctness guarantees; zero runtime overhead from proofs"))
2133

22-
(adr "003-rsr-template"
34+
(adr "005-rsr-template"
2335
(status "accepted")
2436
(context "Need consistent project structure across 29+ -iser repos")
2537
(decision "All repos cloned from rsr-template-repo with full CI/CD and governance")
2638
(consequences "17 workflows, SECURITY.md, CONTRIBUTING, bot directives from day one")))
2739

2840
(development-practices
29-
(language "Rust" (purpose "CLI and orchestration"))
30-
(language "Idris2" (purpose "ABI formal proofs"))
31-
(language "Zig" (purpose "FFI C-ABI bridge"))
41+
(language "Rust" (purpose "CLI orchestration, manifest parsing, codegen pipeline"))
42+
(language "Idris2" (purpose "ABI formal proofs: layer subset correctness, smart-default safety, layout verification"))
43+
(language "Zig" (purpose "FFI C-ABI bridge: API analysis runtime, complexity scoring, layer generation"))
3244
(build-tool "cargo")
3345
(ci "GitHub Actions (17 workflows)"))
3446

3547
(design-rationale
48+
(principle "Progressive disclosure"
49+
(explanation "Every API should teach itself — users see only what they need, and can peel back layers as they grow"))
50+
(principle "Formally verified layers"
51+
(explanation "Idris2 dependent types prove that @beginner is a subset of @intermediate, which is a subset of @expert"))
52+
(principle "Smart defaults are type-safe"
53+
(explanation "Inferred defaults are validated against type constraints; Idris2 proves they cannot violate invariants"))
3654
(principle "Manifest-driven"
37-
(explanation "User intent captured in TOML; all generation is deterministic and reproducible"))
38-
(principle "Formally verified bridges"
39-
(explanation "Idris2 dependent types prove interface correctness at compile time"))
40-
(principle "Zero target language exposure"
41-
(explanation "Users never write Chapel/Julia/Futhark/etc. — the -iser handles everything"))))
55+
(explanation "User intent captured in mylangiser.toml; all generation is deterministic and reproducible"))))
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
#
4-
# NEUROSYM.a2ml — Neurosymbolic integration metadata
4+
# NEUROSYM.a2ml — Neurosymbolic integration metadata for mylangiser
55
# Configuration for Hypatia scanning and symbolic reasoning.
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "{{CURRENT_DATE}}"
9+
last-updated = "2026-03-21"
1010

1111
[hypatia-config]
1212
scan-enabled = true
1313
scan-depth = "standard" # quick | standard | deep
1414
report-format = "logtalk"
1515

1616
[symbolic-rules]
17-
# Custom symbolic rules for this project
18-
# - { name = "no-unsafe-ffi", pattern = "believe_me|unsafeCoerce", severity = "critical" }
17+
# Mylangiser-specific symbolic rules for Hypatia:
18+
# - Disclosure level ordering: @beginner < @intermediate < @expert (always)
19+
# - Complexity score bounds: 0 <= score <= 100
20+
# - Layer monotonicity: beginner_params <= intermediate_params <= expert_params
21+
# - Smart default safety: inferred defaults must satisfy type constraints
22+
# - No unsafe FFI patterns (believe_me, unsafeCoerce banned)
1923

2024
[neural-config]
21-
# Neural pattern detection settings
25+
# Neural pattern detection for API surface analysis:
26+
# - Detect CRUD patterns in endpoint names
27+
# - Detect pagination patterns in parameter lists
28+
# - Detect auth/retry patterns for smart default inference
2229
# confidence-threshold = 0.85
2330
# model = "hypatia-v2"
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,40 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
#
4-
# PLAYBOOK.a2ml — Operational playbook
4+
# PLAYBOOK.a2ml — Operational playbook for mylangiser
55
# Runbooks, incident response, deployment procedures.
66

77
[metadata]
88
version = "0.1.0"
9-
last-updated = "{{CURRENT_DATE}}"
9+
last-updated = "2026-03-21"
1010

1111
[deployment]
12-
# method = "gitops" # gitops | manual | ci-triggered
13-
# target = "container" # container | binary | library | wasm
12+
method = "gitops"
13+
target = "binary" # Rust CLI binary + Zig shared library
14+
15+
[build-pipeline]
16+
# 1. cargo build --release (Rust CLI)
17+
# 2. cd src/interface/ffi && zig build (Zig FFI library)
18+
# 3. cargo test (Rust unit tests)
19+
# 4. cd src/interface/ffi && zig build test (Zig unit tests)
1420

1521
[incident-response]
16-
# 1. Check .machine_readable/STATE.a2ml for current status
22+
# 1. Check .machine_readable/6a2/STATE.a2ml for current status
1723
# 2. Review recent commits and CI results
18-
# 3. Run `just validate` to check compliance
24+
# 3. Run `just validate` to check RSR compliance
1925
# 4. Run `just security` to audit for vulnerabilities
26+
# 5. For layer-generation bugs: check Idris2 proofs in src/interface/abi/
2027

2128
[release-process]
22-
# 1. Update version in STATE.a2ml, META.a2ml, Justfile
29+
# 1. Update version in STATE.a2ml, META.a2ml, Cargo.toml, Justfile
2330
# 2. Run `just release-preflight` (validate + quality + security + maint-hard-pass)
24-
# 3. Optional local permission hardening: `just perms-snapshot && just perms-lock`
25-
# 4. Tag and push
26-
# 5. Restore local permissions if needed: `just perms-restore`
31+
# 3. Verify Idris2 ABI proofs compile cleanly
32+
# 4. Run end-to-end test: mylangiser generate on example manifest
33+
# 5. Tag and push
2734
# 6. Run `just container-push` if applicable
2835

2936
[maintenance-operations]
30-
# Baseline audit:
31-
# just maint-audit
32-
# Hard release gate:
33-
# just maint-hard-pass
34-
# Permission audit:
35-
# just perms-audit
37+
# Baseline audit: just maint-audit
38+
# Hard release gate: just maint-hard-pass
39+
# Permission audit: just perms-audit
40+
# ABI verification: cd src/interface/abi && idris2 --check Types.idr Layout.idr Foreign.idr

.machine_readable/6a2/STATE.a2ml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,34 @@
55
(state
66
(metadata
77
(version "0.1.0")
8-
(last-updated "2026-03-20")
8+
(last-updated "2026-03-21")
99
(author "Jonathan D.A. Jewell"))
1010

1111
(project-context
1212
(name "mylangiser")
13-
(description "Generate progressive-disclosure interfaces via My-Lang")
14-
(status "scaffold")
13+
(description "Analyse complex API surfaces and generate progressive-disclosure wrappers with beginner/intermediate/expert levels via My-Lang")
14+
(status "scaffold-documented")
1515
(priority "—")
1616
(ecosystem "-iser family (https://github.com/hyperpolymath/iseriser)"))
1717

1818
(current-position
19-
(phase "initial-scaffold")
20-
(completion-percentage 5)
21-
(milestone "Architecture defined, CLI scaffolded, RSR template complete"))
19+
(phase "scaffold-documented")
20+
(completion-percentage 10)
21+
(milestone "Architecture defined, CLI scaffolded, RSR template complete, all docs bespoke, Idris2 ABI domain types defined, Zig FFI domain stubs implemented"))
2222

2323
(route-to-mvp
24-
(step 1 "Replace codegen stubs with target-language-specific generation")
25-
(step 2 "Implement Idris2 ABI proofs for core invariants")
26-
(step 3 "Build Zig FFI bridge")
27-
(step 4 "Integration tests with real-world examples")
28-
(step 5 "Documentation and examples"))
24+
(step 1 "Implement API surface analysis: parse mylangiser.toml, build endpoint model")
25+
(step 2 "Implement complexity scoring: cognitive-load formula, threshold configuration")
26+
(step 3 "Implement My-Lang layer generation: @beginner/@intermediate/@expert codegen")
27+
(step 4 "Implement smart default inference from type constraints and API docs")
28+
(step 5 "Write Idris2 ABI proofs for layer subset correctness")
29+
(step 6 "End-to-end test: real API manifest -> three-tier wrapper output")
30+
(step 7 "Documentation, examples, ecosystem integration"))
2931

3032
(blockers-and-issues
31-
(none "Project is in scaffold phase — no blockers yet"))
33+
(none "Project is in scaffold-documented phase — no blockers yet"))
3234

3335
(critical-next-actions
34-
(action "Implement codegen for primary use case")
35-
(action "Write first working example end-to-end")))
36+
(action "Implement API surface analysis (parse manifest, classify parameters)")
37+
(action "Implement complexity scoring algorithm")
38+
(action "First working example: simple REST API -> layered wrapper")))

.machine_readable/ai/AI.a2ml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,48 @@
1-
2-
# AI Assistant Instructions
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# AI.a2ml — AI assistant instructions for mylangiser
35

46
## Repository Focus
5-
- `rsr-template-repo` is treated as a Rhodium Standard Repository; obey the Rhodium policies and keep `.machine_readable/` authoritative.
6-
- All machine-readable content lives under `.machine_readable/` — state files (a2ml), bot directives, and contractiles.
7-
- Prefer to keep generated files out of source control, and regenerate them with the documented commands before committing.
7+
8+
- **mylangiser** generates progressive-disclosure interfaces from complex APIs.
9+
- Three disclosure levels: @beginner (smart defaults, simplified), @intermediate
10+
(full params, named args), @expert (raw API, escape hatches).
11+
- Core pipeline: manifest -> API analysis -> complexity scoring -> Idris2 ABI
12+
proofs -> My-Lang codegen -> layered wrapper.
13+
- All machine-readable content lives under `.machine_readable/` -- state files
14+
(a2ml), bot directives, and contractiles.
15+
16+
## Domain Rules
17+
18+
- **Disclosure ordering is invariant**: Beginner < Intermediate < Expert.
19+
Never generate a wrapper where beginner exposes more than intermediate.
20+
- **Complexity scores are bounded 0-100**. Never exceed.
21+
- **Smart defaults must be type-safe**: if you add a default, verify it
22+
satisfies the parameter's type constraints.
23+
- **Layer monotonicity**: beginner_params <= intermediate_params <= expert_params.
824

925
## Workflow
10-
1. Inspect `.machine_readable/STATE.a2ml` for blockers and next actions.
11-
2. Respect any constraints listed inside `.machine_readable/AGENTIC.a2ml` when tooling changes are requested.
12-
3. After finishing edits, update STATE with your outcomes and commit with a concise, imperative message.
26+
27+
1. Inspect `.machine_readable/6a2/STATE.a2ml` for blockers and next actions.
28+
2. Respect constraints in `.machine_readable/6a2/AGENTIC.a2ml`.
29+
3. After finishing edits, update STATE with your outcomes and commit.
30+
31+
## Key Files
32+
33+
- `src/interface/abi/Types.idr` -- DisclosureLevel, ComplexityScore, APIEndpoint,
34+
LayeredWrapper, SmartDefault
35+
- `src/interface/abi/Layout.idr` -- APISurfaceDescriptor, EndpointDescriptor,
36+
WrapperDescriptor memory layouts
37+
- `src/interface/abi/Foreign.idr` -- FFI declarations for analysis, scoring,
38+
layer generation
39+
- `src/interface/ffi/src/main.zig` -- FFI implementation
40+
- `src/main.rs` -- CLI entry point
41+
- `src/manifest/` -- mylangiser.toml parser
42+
- `src/codegen/` -- My-Lang layer generation
1343

1444
## Delivery Promises
15-
- Mention in summaries whether STATE, `.machine_readable/contractiles/`, or `.machine_readable/bot_directives/` changed.
16-
- Keep this file in sync with the repository's status; update it if the governance changes.
45+
46+
- Mention in summaries whether STATE, `.machine_readable/contractiles/`, or
47+
`.machine_readable/bot_directives/` changed.
48+
- Keep this file in sync with the repository's status.

0 commit comments

Comments
 (0)