Skip to content
Open
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
69 changes: 69 additions & 0 deletions cli/tests/test_publication_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import importlib.util
import json
from pathlib import Path

import pytest
Expand All @@ -17,6 +18,18 @@
spec.loader.exec_module(pp)


def load_publication_policy(tmp_path: Path, monkeypatch):
monkeypatch.setenv("LIMEN_ROOT", str(tmp_path))
spec = importlib.util.spec_from_file_location(
"publication_policy_under_test",
ROOT / "scripts" / "publication-policy.py",
)
module = importlib.util.module_from_spec(spec)
assert spec and spec.loader
spec.loader.exec_module(module)
return module


# --- the redactor scrubs OWNER identifiers -----------------------------------
@pytest.mark.parametrize(
"src,want",
Expand Down Expand Up @@ -123,3 +136,59 @@ def test_self_test_passes():
def test_residual_pii_detects_and_clears():
assert pp._residual_pii("Anthony Padavano here") is not None
assert pp._residual_pii(pp.redact("Anthony Padavano here")) is None


def test_maturity_assessment_includes_converged_gate_refs():
assessment = pp._assess_maturity([])
assert "convergence_authority_referenced" in assessment["passed"]
assert assessment["maturity_pct"] >= 80


def test_publication_policy_maturity_advance_selects_rank10_entry(tmp_path: Path, monkeypatch):
module = load_publication_policy(tmp_path, monkeypatch)
ladder = tmp_path / "organ-ladder.json"
ladder.write_text(
json.dumps(
{
"organs": [
{
"rank": 5,
"pillar": "governance",
"organ": "Aerarium / Cvrsvs Honorvm",
"maturity": 75,
"stage": "maturing",
"note": "cursus honorum — already wired",
},
{
"rank": 10,
"pillar": "governance",
"organ": "Publication Policy (the disclosure court)",
"maturity": 60,
"stage": "building",
"note": "converges gates; beat C_PUBPOLICY, rung PUBPOLICY",
},
]
},
ensure_ascii=False,
)
)

result = module._advance_maturity({"maturity_pct": 80})

assert result["bumped"] is True
text = ladder.read_text()
assert "cursus honorum — already wired" in text
assert "\\u2014" not in text
data = json.loads(text)
aerarium, pubpolicy = data["organs"]
assert aerarium["maturity"] == 75
assert aerarium["stage"] == "maturing"
assert "publication-policy.py" not in aerarium["note"]
assert pubpolicy["maturity"] == 80
assert pubpolicy["stage"] == "maturing"
assert "Maturity 60%->80% auto-advanced by publication-policy.py beat" in pubpolicy["note"]

second = module._advance_maturity({"maturity_pct": 80})

assert second["bumped"] is False
assert ladder.read_text().count("Maturity 60%->80% auto-advanced by publication-policy.py beat") == 1
4 changes: 2 additions & 2 deletions institutio/governance/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1152,13 +1152,13 @@ parameters:
env: LIMEN_BEAT_PUBPOLICY
self_update: none
owner: pubpolicy
note: "Beat cadence for the publication-policy organ (scripts/publication-policy.py --verify): re-prove the content-disposition engine stays sound (redactor owner-scoped, matrix + classifier intact) every N beats. Read-only self-test, stamps logs/publication-policy-state.json."
note: "Beat cadence for the publication-policy organ (scripts/publication-policy.py --verify): re-prove the content-disposition engine stays sound (redactor owner-scoped, matrix + classifier intact) every N beats, stamp logs/publication-policy-state.json, and advance the rank-10 Publication Policy maturity in organ-ladder.json when objective criteria grow."
LIMEN_PUBPOLICY:
default: "1" # ON — verify the disposition engine each due beat
env: LIMEN_PUBPOLICY
self_update: none
owner: pubpolicy
note: "Beat gate for the publication-policy organ (the ONE content-disposition decision: repo visibility x content class -> disposition). 1=self-verify each due beat; 0=off. Fail-open, never gates the beat. See organs/governance/PUBLICATION-POLICY.md."
note: "Beat gate for the publication-policy organ (the ONE content-disposition decision: repo visibility x content class -> disposition). 1=self-verify and self-feed each due beat; 0=off. Fail-open, never gates the beat. See organs/governance/PUBLICATION-POLICY.md."
LIMEN_OWNER_IDENTITY:
default: "" # unset — the redactor uses its built-in owner instance
env: LIMEN_OWNER_IDENTITY
Expand Down
26 changes: 13 additions & 13 deletions organ-ladder.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"_comment": "VLTIMA MATERIA institutional census, made executable. The rich win because civilization's pillars (a legal org, a family office, a PR machine) stand behind them; this ranks those same pillars rebuilt as AI-run ORGANS so the idle fleet can build them continuously. Mirror of revenue-ladder.json: generate-organ-backlog.py reads this and emits bounded, lockless organ-build tasks toward each organ's next maturity band. Identity/levers are DERIVED here, never pinned in code. Each organ is a FRACTAL: macro (a platform anyone can hold) + micro (Anthony's own instance). Build stages: scaffold(<30%) -> building(30-60%) -> maturing(60-90%) -> mature(>=90, no build tasks). Organ artifacts are authored into the limen repo under organs/<pillar>/ (same proven home as the Studium) so dispatch never hits a dead clone; repo-specific product code is handled by the revenue/coverage generators.",
"spine": "Institutional weight for one person, then anyone \u2014 the prosthesis for human weakness. Not tips; institutions.",
"spine": "Institutional weight for one person, then anyone the prosthesis for human weakness. Not tips; institutions.",
"maturity_stages": {
"scaffold": "0-29% \u2014 kernel + charter + first vertical slice",
"building": "30-59% \u2014 close the gap to a usable institution; wire it self-feeding",
"maturing": "60-89% \u2014 excellent macro+micro face; operationalize governance",
"mature": ">=90% \u2014 self-running; no generated build work"
"scaffold": "0-29% kernel + charter + first vertical slice",
"building": "30-59% close the gap to a usable institution; wire it self-feeding",
"maturing": "60-89% excellent macro+micro face; operationalize governance",
"mature": ">=90% self-running; no generated build work"
},
"organs": [
{
Expand Down Expand Up @@ -94,15 +94,15 @@
"organ": "Publication Policy (the disclosure court)",
"repo": "organvm/limen",
"home": "organs/governance/",
"maturity": 60,
"stage": "building",
"maturity": 80,
"stage": "maturing",
"whose_hand": "mine (the publish / flip-visibility click is his)",
"rival": "a newsroom standards desk + a data-protection office fused into one rule table",
"domain_map": "(repo visibility x content class) -> one disposition; owner-scoped redaction as case law",
"macro": "a portable content-disposition standard any repo/estate can defer to instead of judging per-file",
"micro": "ORGANVM's own PII/strategy sweep: the ONE answer for 'does this belong on this repo'",
"first_artifact": "scripts/publication-policy.py --verify green; matrix + owner-scoped redactor shipped (2026-07-02)",
"note": "converges the scattered gates (creds _SECRET_RX, scan-legacy SENSITIVE_PATTERNS, persona contracts, positioning awaiting_publish) behind one referenced rule table; beat C_PUBPOLICY, rung PUBPOLICY"
"note": "converges the scattered gates (creds _SECRET_RX, scan-legacy SENSITIVE_PATTERNS, persona contracts, positioning awaiting_publish) behind one referenced rule table; beat C_PUBPOLICY, rung PUBPOLICY. Maturity 60%->80% auto-advanced by publication-policy.py beat (2026-07-03)."
},
{
"rank": 6,
Expand Down Expand Up @@ -178,13 +178,13 @@
"codex (87% efficiency, the best earner)",
"jules (94% idle)"
],
"binding_constraint": "SUPPLY of high-value work, not capacity \u2014 these organs ARE the supply",
"binding_constraint": "SUPPLY of high-value work, not capacity these organs ARE the supply",
"source": "logs/usage-limits.json, logs/usage.json, logs/ledger.json (assessed 2026-06-23)"
},
"your_levers": [
"card-0186 Santander fraud hold \u2014 keystone: the whole stack's billing rides on it (one call clears it; also frees Anthropic/GitHub autopay)",
"financial identity \u2014 receiving real money (bank/KYC for a payout rail or a signed deal) is genuinely yours",
"the send / the signature \u2014 outbound emails and any contract: I draft, you send/sign (reversible-only invariant)",
"institutional logins \u2014 D2L (education), and privileged/filing acts with Micah (legal)"
"card-0186 Santander fraud hold keystone: the whole stack's billing rides on it (one call clears it; also frees Anthropic/GitHub autopay)",
"financial identity receiving real money (bank/KYC for a payout rail or a signed deal) is genuinely yours",
"the send / the signature outbound emails and any contract: I draft, you send/sign (reversible-only invariant)",
"institutional logins D2L (education), and privileged/filing acts with Micah (legal)"
]
}
16 changes: 15 additions & 1 deletion organs/governance/PUBLICATION-POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ clear and never re-litigated.

- **Engine:** [`scripts/publication-policy.py`](../../scripts/publication-policy.py)
- **Tests / predicate:** [`cli/tests/test_publication_policy.py`](../../cli/tests/test_publication_policy.py) + `publication-policy.py --verify`
- **Beat:** `C_PUBPOLICY` (heartbeat) → `--verify` each cycle → stamps `logs/publication-policy-state.json` → proprioception rung `PUBPOLICY`.
- **Beat:** `C_PUBPOLICY` (heartbeat) → `--verify` each cycle → stamps `logs/publication-policy-state.json` → proprioception rung `PUBPOLICY` → advances this organ's `organ-ladder.json` maturity when objective checks pass.

## The decision

Expand Down Expand Up @@ -85,3 +85,17 @@ python3 scripts/publication-policy.py --verify # is the engin

The 2026-07-02 PII-sweep re-audit was resolved *by this engine* — see
[`DISCLOSURE-AUDIT.md`](DISCLOSURE-AUDIT.md) for the per-repo disposition ledger it produced.

## Self-feed

The publication-policy beat is not just a smoke test. `scripts/publication-policy.py --verify`
assesses the rank-10 `Publication Policy` organ from repo-local criteria: engine soundness,
test coverage, heartbeat wiring, proprioception wiring, parameter registration, and whether the
legacy gates above all point back to this rule table. When the assessed maturity exceeds the
stored maturity, it updates only the `Publication Policy` entry in `organ-ladder.json` through a
mkdir lock plus atomic replace. It never touches `tasks.yaml`, never dispatches work, and never
lowers maturity.

The remaining 20% is intentionally held behind the estate cleanup in
[`DISCLOSURE-AUDIT.md`](DISCLOSURE-AUDIT.md): verified/stripped public-HEAD residuals, resolved
inferred cases, and external/his-hand residues.
7 changes: 4 additions & 3 deletions scripts/heartbeat-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ C_HEALTH="${LIMEN_BEAT_HEALTH:-6}" # CARE (refresh the personal health off
C_LIFE="${LIMEN_BEAT_LIFE:-6}" # STEWARD (refresh the digital-life office: accounts/assets/subscription purge clock; PII off-repo)
C_GOVERNANCE="${LIMEN_BEAT_GOVERNANCE:-8}" # GOVERN (run the cursus honorum seed validator + governance standing report)
C_FINANCIAL="${LIMEN_BEAT_FINANCIAL:-8}" # FINANCE (run the financial-office consolidator + advance maturity)
C_PUBPOLICY="${LIMEN_BEAT_PUBPOLICY:-8}" # DISCLOSE (verify the content-disposition engine: redactor owner-scoped, matrix + classifier intact)
C_PUBPOLICY="${LIMEN_BEAT_PUBPOLICY:-8}" # DISCLOSE (verify the content-disposition engine + advance Publication Policy maturity)
C_WALLS="${LIMEN_BEAT_WALLS:-12}" # WALLS (regenerate the credential Wall #320 + his-hand Wall #330 so they never drift)
C_CVSTOS="${LIMEN_BEAT_CVSTOS:-24}" # KEEP (CVSTOS — host stays factory: chat-app/local debt census + factory-invariant + reaper proprioception; filesystem walk ⇒ rare)
C_VVLTVS="${LIMEN_BEAT_VVLTVS:-24}" # FACE (VVLTVS — verify the public face reflects the live SSOT: profile/portfolio drift + contribution-mix radar; offline read ⇒ cheap)
Expand Down Expand Up @@ -501,8 +501,9 @@ while true; do
{ python3 "$LIMEN_ROOT/scripts/financial-organ.py" 2>&1 | tail -1 || true; stamp financial; }
# DISCLOSE — verify the publication-policy engine (the ONE content-disposition decision) stays sound
# every C_PUBPOLICY beats: redactor owner-scoped (never eats product emails / placeholders / 555
# fixtures), disposition matrix + classifier intact. Read-only self-test, stamps the pubpolicy voice.
# Idempotent, fail-open — never gates the beat. Gate off with LIMEN_PUBPOLICY=0.
# fixtures), disposition matrix + classifier intact. Also assesses and advances the rank-10
# Publication Policy maturity in organ-ladder.json when objective checks grow. Idempotent,
# fail-open — never gates the beat. Gate off with LIMEN_PUBPOLICY=0.
due_voice pubpolicy "$C_PUBPOLICY" && [ "${LIMEN_PUBPOLICY:-1}" = "1" ] && \
{ python3 "$LIMEN_ROOT/scripts/publication-policy.py" --verify 2>&1 | tail -1 || true; stamp pubpolicy; }
# CVSTOS — the keeper of the host. Every C_CVSTOS beats: census the chat-app/local debt (all
Expand Down
2 changes: 1 addition & 1 deletion scripts/organ-health.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def _registry():
probe=lambda: _mtime(LOGS / "governance-organ-state.json")),
dict(key="pubpolicy", rung="PUBPOLICY", voice="pubpolicy", cadence_key="PUBPOLICY",
gate="LIMEN_PUBPOLICY", gate_default="1",
what="content-disposition engine: (repo visibility x content class) -> one disposition; owner-scoped redactor",
what="content-disposition engine: (repo visibility x content class) -> one disposition; owner-scoped redactor; rank-10 maturity self-feed",
probe=lambda: _mtime(LOGS / "publication-policy-state.json")),
dict(key="cvstos", rung="CVSTOS", voice="cvstos", cadence_key="CVSTOS",
gate="LIMEN_CVSTOS", gate_default="1",
Expand Down
Loading
Loading