Skip to content

Commit 5676811

Browse files
hyperpolymathclaude
andcommitted
docs: replace template placeholders with bespoke phronesiser content
Replace all generic -iser template content with phronesiser-specific deontic logic types, ethical constraint engine implementation, and domain documentation. Idris2 ABI now defines DeonticModality, EthicalConstraint, ValueAlignment, HarmPrevention, and AuditDecision with formal proofs. Zig FFI implements constraint evaluation engine with add/remove/evaluate/audit-trail operations. README, ROADMAP, TOPOLOGY, and all 6a2 machine-readable files updated to reflect the ethical constraint domain. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e7eaa70 commit 5676811

File tree

17 files changed

+1641
-505
lines changed

17 files changed

+1641
-505
lines changed

.machine_readable/6a2/AGENTIC.a2ml

Lines changed: 12 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 phronesiser
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,9 @@ 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 introduce obligation/prohibition contradictions in constraint sets
26+
# - Never allow AuditDecision to be silently dropped (every action must be audited)
27+
# - Never weaken existing harm prevention boundaries without explicit justification
2528

2629
[maintenance-integrity]
2730
fail-closed = true
@@ -30,6 +33,13 @@ allow-silent-skip = false
3033
require-rerun-after-fix = true
3134
release-claim-requires-hard-pass = true
3235

36+
[domain-specific-rules]
37+
# Phronesiser-specific invariants:
38+
# - DeonticModality must remain a closed enum (Obligation | Permission | Prohibition)
39+
# - AuditDecision must remain a trichotomy (Permitted | Denied | Escalated)
40+
# - HarmSeverity ordering must be monotonic (Negligible < Minor < Moderate < Severe < Critical)
41+
# - Constraint evaluation must be deterministic (same inputs = same AuditDecision)
42+
3343
[automation-hooks]
3444
# on-enter: Read 0-AI-MANIFEST.a2ml, then STATE.a2ml
3545
# on-exit: Update STATE.a2ml with session outcomes

.machine_readable/6a2/ECOSYSTEM.a2ml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
(version "0.1.0")
77
(name "phronesiser")
88
(type "tool")
9-
(purpose "Add provably safe ethical constraints to AI agents")
9+
(purpose "Add provably safe ethical constraints to AI agents via Phronesis deontic logic")
1010

1111
(position-in-ecosystem
1212
(family "-iser acceleration frameworks")
1313
(meta-framework "iseriser")
1414
(relationship "sibling")
15-
(top-3 ("typedqliser" "chapeliser" "verisimiser")))
15+
(domain "AI safety and ethics — deontic constraint enforcement")
16+
(unique-value "Only -iser that provides formal ethical guarantees via deontic logic proofs"))
1617

1718
(related-projects
1819
(project "iseriser"
@@ -27,12 +28,21 @@
2728
(project "verisimiser"
2829
(relationship "sibling-priority-3")
2930
(description "VeriSimDB octad database augmentation"))
30-
(project "squeakwell"
31-
(relationship "sibling")
32-
(description "Database recovery via constraint propagation"))
31+
(project "phronesis"
32+
(relationship "upstream-language")
33+
(description "Nextgen language for ethical reasoning on the BEAM VM — phronesiser makes it accessible"))
3334
(project "proven"
3435
(relationship "dependency")
35-
(description "Shared Idris2 verified library"))
36+
(description "Shared Idris2 verified library — may share deontic logic proof modules"))
3637
(project "typell"
3738
(relationship "dependency")
38-
(description "Type theory engine"))))
39+
(description "Type theory engine"))
40+
(project "boj-server"
41+
(relationship "integration-target")
42+
(description "MCP server — phronesiser cartridge for constraint management"))
43+
(project "verisimdb"
44+
(relationship "integration-target")
45+
(description "Backing store for audit trail persistence"))
46+
(project "panll"
47+
(relationship "integration-target")
48+
(description "Panel framework — constraint visualisation and editing panels"))))

.machine_readable/6a2/META.a2ml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,60 @@
44

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

99
(architecture-decisions
1010
(adr "001-iser-pattern"
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 "Need to make Phronesis ethical reasoning accessible without learning deontic logic")
13+
(decision "Use manifest-driven code generation: user describes ethical constraints in TOML, phronesiser generates formally verified guardrails")
14+
(consequences "Users write zero Phronesis code; all deontic logic complexity hidden in the -iser"))
1515

1616
(adr "002-abi-ffi-standard"
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")
20-
(consequences "Compile-time correctness guarantees; zero runtime overhead from proofs"))
18+
(context "Need verified interop between Rust CLI, Phronesis constraint engine, and user agents")
19+
(decision "Idris2 ABI for formal proofs of constraint soundness, Zig FFI for C-ABI constraint evaluation bridge")
20+
(consequences "Compile-time guarantees that obligation/prohibition sets are non-contradictory; zero runtime overhead"))
2121

22-
(adr "003-rsr-template"
22+
(adr "003-deontic-logic-model"
23+
(status "accepted")
24+
(context "Need formal model for ethical constraints that is both rigorous and practical")
25+
(decision "Use standard deontic logic: Obligation (must), Permission (may), Prohibition (must-not)")
26+
(consequences "Well-studied formal system; decidable evaluation; clear audit trail semantics"))
27+
28+
(adr "004-audit-decision-trichotomy"
29+
(status "accepted")
30+
(context "Every agent action must produce exactly one auditable decision")
31+
(decision "Three-outcome model: Permitted (proof of safety), Denied (proof of violation), Escalated (ambiguity)")
32+
(consequences "No silent failures; human oversight for genuinely ambiguous cases; complete audit trail"))
33+
34+
(adr "005-harm-prevention-taxonomy"
35+
(status "accepted")
36+
(context "Need structured harm classification for constraint severity")
37+
(decision "Six harm domains (physical, psychological, financial, privacy, reputational, environmental) x five severity levels (negligible through critical)")
38+
(consequences "Granular enforcement; severity-proportional responses; domains extensible"))
39+
40+
(adr "006-rsr-template"
2341
(status "accepted")
2442
(context "Need consistent project structure across 29+ -iser repos")
2543
(decision "All repos cloned from rsr-template-repo with full CI/CD and governance")
2644
(consequences "17 workflows, SECURITY.md, CONTRIBUTING, bot directives from day one")))
2745

2846
(development-practices
29-
(language "Rust" (purpose "CLI and orchestration"))
30-
(language "Idris2" (purpose "ABI formal proofs"))
31-
(language "Zig" (purpose "FFI C-ABI bridge"))
47+
(language "Rust" (purpose "CLI orchestration and manifest parsing"))
48+
(language "Idris2" (purpose "ABI formal proofs — deontic soundness, constraint non-contradiction"))
49+
(language "Zig" (purpose "FFI C-ABI bridge — constraint evaluation engine"))
3250
(build-tool "cargo")
3351
(ci "GitHub Actions (17 workflows)"))
3452

3553
(design-rationale
54+
(principle "Deontic soundness"
55+
(explanation "Obligation and prohibition must never apply to the same scope — proven at compile time via Idris2"))
56+
(principle "Audit completeness"
57+
(explanation "Every evaluated action produces exactly one AuditDecision — no silent failures"))
58+
(principle "Severity-proportional enforcement"
59+
(explanation "Harm severity determines response: negligible=log, minor=warn, moderate=require-permission, severe=block, critical=immediate-deny"))
3660
(principle "Manifest-driven"
37-
(explanation "User intent captured in TOML; all generation is deterministic and reproducible"))
61+
(explanation "User intent captured in TOML; all constraint generation is deterministic and reproducible"))
3862
(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"))))
63+
(explanation "Idris2 dependent types prove interface correctness at compile time"))))
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
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 phronesiser
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
13-
scan-depth = "standard" # quick | standard | deep
13+
scan-depth = "deep" # deep because ethical constraints demand thorough analysis
1414
report-format = "logtalk"
1515

1616
[symbolic-rules]
17-
# Custom symbolic rules for this project
17+
# Phronesiser-specific symbolic rules:
1818
# - { name = "no-unsafe-ffi", pattern = "believe_me|unsafeCoerce", severity = "critical" }
19+
# - { name = "deontic-soundness", pattern = "Obligation.*Prohibition.*same-scope", severity = "critical" }
20+
# - { name = "audit-completeness", pattern = "evaluate.*without.*AuditDecision", severity = "critical" }
21+
# - { name = "harm-severity-ordering", pattern = "Negligible.*>.*Critical", severity = "error" }
1922

2023
[neural-config]
21-
# Neural pattern detection settings
22-
# confidence-threshold = 0.85
24+
# Neural pattern detection settings for ethical constraint analysis
25+
# confidence-threshold = 0.95 (higher than default — ethics demands certainty)
2326
# model = "hypatia-v2"
27+
# domain = "deontic-logic"
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
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 phronesiser
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 = "ci-triggered"
13+
target = "library" # phronesiser is a Rust CLI + Zig shared library
1414

1515
[incident-response]
16-
# 1. Check .machine_readable/STATE.a2ml for current status
16+
# 1. Check .machine_readable/6a2/STATE.a2ml for current status
1717
# 2. Review recent commits and CI results
1818
# 3. Run `just validate` to check compliance
1919
# 4. Run `just security` to audit for vulnerabilities
20+
# 5. If constraint evaluation bugs: check Zig FFI tests first (src/interface/ffi/test/)
21+
# 6. If ABI mismatch: verify Idris2 types match Zig struct layouts
2022

2123
[release-process]
22-
# 1. Update version in STATE.a2ml, META.a2ml, Justfile
24+
# 1. Update version in STATE.a2ml, META.a2ml, Cargo.toml, Justfile
2325
# 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`
27-
# 6. Run `just container-push` if applicable
26+
# 3. Verify constraint evaluation correctness: `cd src/interface/ffi && zig build test`
27+
# 4. Optional local permission hardening: `just perms-snapshot && just perms-lock`
28+
# 5. Tag and push
29+
# 6. Restore local permissions if needed: `just perms-restore`
30+
# 7. Run `just container-push` if applicable
2831

2932
[maintenance-operations]
3033
# Baseline audit:
@@ -33,3 +36,7 @@ last-updated = "{{CURRENT_DATE}}"
3336
# just maint-hard-pass
3437
# Permission audit:
3538
# just perms-audit
39+
# Constraint engine test:
40+
# cd src/interface/ffi && zig build test
41+
# Rust CLI test:
42+
# cargo test

.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 "phronesiser")
13-
(description "Add provably safe ethical constraints to AI agents")
14-
(status "scaffold")
13+
(description "Provably safe ethical constraints for AI agents via Phronesis deontic logic")
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 15)
21+
(milestone "Architecture defined, CLI scaffolded, RSR template complete, ABI/FFI types bespoke, documentation complete"))
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 Phronesis constraint compilation from TOML to deontic propositions")
25+
(step 2 "Complete Idris2 ABI proofs: DeonticModality soundness, NoContradiction, AuditDecision completeness")
26+
(step 3 "Complete Zig FFI constraint evaluation engine (beyond stub)")
27+
(step 4 "End-to-end example: AI agent with obligation/prohibition guardrails")
28+
(step 5 "Constraint conflict detection (obligation vs prohibition on same scope)")
29+
(step 6 "Audit trail generation with structured JSON output")
30+
(step 7 "Integration tests with real-world constraint sets"))
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 TOML-to-deontic-proposition constraint compiler in codegen/mod.rs")
37+
(action "Define phronesiser.toml schema for obligations, permissions, prohibitions, harm boundaries")
38+
(action "Write first end-to-end example: content moderation constraint set")))

0 commit comments

Comments
 (0)