Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .machine_readable/arrival-pack/arrival-pack.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
#
# The a2ml files remain the single source of truth; this is a VIEW. Hand-editing
# the emitted region is a flagged error (see claude-md.k9.ncl drift check).

let data = import "claude-md-data.json" in

# Pin to a Manifesto commit once the doctrine wording is ratified into the
# owner's voice. Until then the estate-common block is explicitly DRAFT.
let manifesto_pin = "DRAFT-unratified" in

let provenance =
"CLADE@%{data.h_clade} ECOSYSTEM@%{data.h_eco} AGENTIC@%{data.h_agentic} STATE@%{data.h_state} ANCHOR@%{data.h_anchor}"
let provenance = "CLADE@%{data.h_clade} ECOSYSTEM@%{data.h_eco} AGENTIC@%{data.h_agentic} STATE@%{data.h_state} ANCHOR@%{data.h_anchor}"
in

m%"
Expand Down
74 changes: 48 additions & 26 deletions .machine_readable/coaptation/coapt.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ let facts = facts_doc.facts in
# --- fact lookup table -------------------------------------------------------
let facts_by_id = std.array.fold_left (fun acc f => acc & { "%{f.id}" = f }) {} facts in
let lookup = fun id =>
if std.record.has_field id facts_by_id then facts_by_id."%{id}"
else { id = id, value = "", present = false } in
if std.record.has_field id facts_by_id then
facts_by_id."%{id}"
else
{ id = id, value = "", present = false }
in

# --- predicate evaluation (does a single witness hold?) ----------------------
let eval_w = fun w =>
Expand All @@ -40,31 +43,49 @@ let eval_w = fun w =>
'equals => f.value == arg,
'contains => std.string.contains arg f.value,
'not_contains => !(std.string.contains arg f.value),
} in
}
in

# --- per-clause evaluation (Coverage) ----------------------------------------
let evals = std.array.map
(fun c =>
let mapped = std.record.has_field c.id wmap in
let entry = if mapped then wmap."%{c.id}" else { kind = "auto", witnesses = [] } in
let base_kind =
if entry.kind != "auto" then entry.kind
else if c.has_probe then "probe"
else "unmeasured" in
let sat =
if base_kind == "descriptile" then std.array.all eval_w entry.witnesses
else false in
let st =
if c.verb == "bust" then (if base_kind == "descriptile" && sat then "alarm" else "latent")
else if c.verb == "dust" then "expected"
else if c.verb == "intend" then (if c.is_wish then "wish:" ++ c.status else "intent:" ++ c.status)
else if base_kind == "descriptile" then (if sat then "witnessed" else "refuted")
else if base_kind == "none" then "gap"
else if base_kind == "probe" then "probe-deferred"
else "unmeasured" in
{ id = c.id, verb = c.verb, status = st, kind = base_kind, wsat = sat, c_status = c.status, is_wish = c.is_wish }
)
clauses in
let evals =
std.array.map
(fun c =>
let mapped = std.record.has_field c.id wmap in
let entry = if mapped then wmap."%{c.id}" else { kind = "auto", witnesses = [] } in
let base_kind =
if entry.kind != "auto" then
entry.kind
else if c.has_probe then
"probe"
else
"unmeasured"
in
let sat =
if base_kind == "descriptile" then
std.array.all eval_w entry.witnesses
else
false
in
let st =
if c.verb == "bust" then
(if base_kind == "descriptile" && sat then "alarm" else "latent")
else if c.verb == "dust" then
"expected"
else if c.verb == "intend" then
(if c.is_wish then "wish:" ++ c.status else "intent:" ++ c.status)
else if base_kind == "descriptile" then
(if sat then "witnessed" else "refuted")
else if base_kind == "none" then
"gap"
else if base_kind == "probe" then
"probe-deferred"
else
"unmeasured"
in
{ id = c.id, verb = c.verb, status = st, kind = base_kind, wsat = sat, c_status = c.status, is_wish = c.is_wish }
)
clauses
in

# --- rollups -----------------------------------------------------------------
let count = fun pred arr => std.array.length (std.array.filter pred arr) in
Expand Down Expand Up @@ -103,7 +124,8 @@ let action =
else if band == "amber" then
"advisory — soft drift within bands (posture/intend). Open an advisory issue; no re-anchor."
else
"none — the descriptile self-model coapts with the contractile set-point within tolerance." in
"none — the descriptile self-model coapts with the contractile set-point within tolerance."
in

# --- render ------------------------------------------------------------------
let clause_lines = std.string.join "\n" (std.array.map (fun e => e.id ++ " = " ++ e.status) evals) in
Expand Down
8 changes: 4 additions & 4 deletions .machine_readable/coaptation/grades.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# a human authority act (see coapt.sh --reanchor).
{
verb_grade = {
must = "boolean_gate",
trust = "boolean_gate_provenance",
must = "boolean_gate",
trust = "boolean_gate_provenance",
adjust = "posture",
intend = "tropical",
bust = "alarm",
dust = "expected",
bust = "alarm",
dust = "expected",
},

tolerances = {
Expand Down
14 changes: 7 additions & 7 deletions .machine_readable/coaptation/witness-map.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# --- MUST: presence obligations attested by the fact that we parsed the file ---
"must.machine-readable-dir" = {
kind = "descriptile",
witnesses = [ { fact = "state.status", op = 'present } ],
witnesses = [{ fact = "state.status", op = 'present }],
note = "descriptiles parse ⇒ .machine_readable/ exists and is populated",
},
"must.six-directory-present" = {
Expand All @@ -38,7 +38,7 @@
},
"must.anchors-directory" = {
kind = "descriptile",
witnesses = [ { fact = "anchor.authority", op = 'present } ],
witnesses = [{ fact = "anchor.authority", op = 'present }],
note = "ANCHOR.a2ml was read from .machine_readable/descriptiles/anchors/",
},

Expand All @@ -55,7 +55,7 @@
# --- INTEND: a committed intent realised by the descriptive self-model ---
"intend.repo-initialization" = {
kind = "descriptile",
witnesses = [ { fact = "ecosystem.type", op = 'equals, arg = "repository-template" } ],
witnesses = [{ fact = "ecosystem.type", op = 'equals, arg = "repository-template" }],
note = "ECOSYSTEM declares this repo IS a template ⇒ the init intent is realised",
},

Expand All @@ -64,25 +64,25 @@
# itself that is expected, but it is honestly a posture dip worth surfacing.
"adjust.placeholder-drift" = {
kind = "descriptile",
witnesses = [ { fact = "anchor.project", op = 'not_contains, arg = "{{" } ],
witnesses = [{ fact = "anchor.project", op = 'not_contains, arg = "{{" }],
note = "ANCHOR.identity.project is un-substituted ({{PROJECT_NAME}}) ⇒ posture dip",
},

# --- BUST: recognised break. For bust, a HOLDING witness means ALARM (active
# failure), not satisfaction. open-failures/last-result are the live signal. ---
"bust.template-substitution-failure" = {
kind = "descriptile",
witnesses = [ { fact = "state.open-failures", op = 'nonzero } ],
witnesses = [{ fact = "state.open-failures", op = 'nonzero }],
note = "alarm iff STATE records open failures; else latent (declared, not active)",
},
"bust.sync-drift-between-repos" = {
kind = "descriptile",
witnesses = [ { fact = "state.open-failures", op = 'nonzero } ],
witnesses = [{ fact = "state.open-failures", op = 'nonzero }],
note = "alarm iff STATE records open failures; else latent",
},
"bust.contractile-parse-error" = {
kind = "descriptile",
witnesses = [ { fact = "state.last-result", op = 'equals, arg = "fail" } ],
witnesses = [{ fact = "state.last-result", op = 'equals, arg = "fail" }],
note = "alarm iff the last maintenance run failed; else latent",
},
}
16 changes: 8 additions & 8 deletions .machine_readable/contractiles/_base.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
# }
#
# See: docs/CONTRACTILE-SPEC.adoc §Shared Base

{
# -------------------------------------------------------------------------
# pedigree_schema
Expand All @@ -49,11 +48,11 @@
# -------------------------------------------------------------------------
pedigree_schema = {
schema_version | String | default = "1.0.0",
contractile_verb | String | default = "UNSET", # MUST override in verb
semantics | String | default = "UNSET", # MUST override in verb
contractile_verb | String | default = "UNSET", # MUST override in verb
semantics | String | default = "UNSET", # MUST override in verb
security = {
leash | [| 'Kennel, 'Yard, 'Hunt |] | default = 'Kennel,
trust_level | String | default = "UNSET", # MUST override in verb
trust_level | String | default = "UNSET", # MUST override in verb
allow_network | Bool | default = false,
allow_filesystem_write | Bool | default = false,
allow_subprocess | Bool | default = true,
Expand All @@ -62,10 +61,10 @@
# destructive_mode_requires_flag (dust)
},
metadata = {
name | String | default = "UNSET", # MUST override in verb
name | String | default = "UNSET", # MUST override in verb
version | String | default = "1.0.0",
description | String | default = "UNSET", # MUST override in verb
paired_xfile | String | default = "UNSET", # MUST override in verb
description | String | default = "UNSET", # MUST override in verb
paired_xfile | String | default = "UNSET", # MUST override in verb
author | String | default = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>",
},
},
Expand Down Expand Up @@ -117,7 +116,8 @@
allowed_exit_codes | Array Number | default = [0],
permission_class
| [| 'read_only, 'filesystem_write, 'subprocess, 'network |]
| default = 'read_only,
| default
= 'read_only,
},

# -------------------------------------------------------------------------
Expand Down
71 changes: 37 additions & 34 deletions .machine_readable/contractiles/adjust/adjust.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,54 @@
#
# Base: ../_base.ncl provides pedigree_schema, run_defaults, probe_schema.
# See: docs/CONTRACTILE-SPEC.adoc

let base = import "../_base.ncl" in

{
pedigree = base.pedigree_schema & {
contractile_verb = "adjust",
semantics = "accessibility compliance",
security = {
leash = 'Kennel,
trust_level = "fixes allowed where deterministic",
allow_network = false,
allow_filesystem_write = true, # `adjust fix` may write (deterministic patches only)
allow_subprocess = true,
},
metadata = {
name = "adjust-runner",
version = "1.0.0",
description = "Evaluates accessibility requirements from Adjustfile.a2ml. Fixes deterministic items; flags the rest for human review.",
paired_xfile = "Adjustfile.a2ml",
author = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>",
pedigree =
base.pedigree_schema
& {
contractile_verb = "adjust",
semantics = "accessibility compliance",
security = {
leash = 'Kennel,
trust_level = "fixes allowed where deterministic",
allow_network = false,
allow_filesystem_write = true, # `adjust fix` may write (deterministic patches only)
allow_subprocess = true,
},
metadata = {
name = "adjust-runner",
version = "1.0.0",
description = "Evaluates accessibility requirements from Adjustfile.a2ml. Fixes deterministic items; flags the rest for human review.",
paired_xfile = "Adjustfile.a2ml",
author = "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>",
},
},
},

schema = {
requirements
| Array {
id | String,
description | String,
# TODO: migrate to base.probe_schema (structured probe) when CLI supports it
probe | String,
# status_core values: 'declared, 'verified, 'failing; adjust adds 'partial
status | [| 'declared, 'partial, 'verified, 'failing |] | default = 'declared,
compliance | String | optional, # e.g. "WCAG 2.1 AA"
notes | String | optional,
fix | String | optional, # deterministic fix command (optional)
},
id | String,
description | String,
# TODO: migrate to base.probe_schema (structured probe) when CLI supports it
probe | String,
# status_core values: 'declared, 'verified, 'failing; adjust adds 'partial
status | [| 'declared, 'partial, 'verified, 'failing |] | default = 'declared,
compliance | String | optional, # e.g. "WCAG 2.1 AA"
notes | String | optional,
fix | String | optional, # deterministic fix command (optional)
},
},

# Runner behaviour — inherits from base.run_defaults.
# adjust is advisory (continue-with-warnings) not a hard gate.
# auto_fix_when_available is adjust-specific.
run = base.run_defaults & {
on_any_fail = "continue-with-warnings", # accessibility is progress-tracked, not a hard gate by default
report_format = "a2ml",
emit_summary = true,
auto_fix_when_available = true,
},
run =
base.run_defaults
& {
on_any_fail = "continue-with-warnings", # accessibility is progress-tracked, not a hard gate by default
report_format = "a2ml",
emit_summary = true,
auto_fix_when_available = true,
},
}
Loading
Loading