Skip to content

Commit 6cae719

Browse files
author
Douglas Jones
committed
README positioning update, dispatch-check PS-3 fix for language.html, session dispatches
1 parent 7127e9c commit 6cae719

7 files changed

Lines changed: 437 additions & 7 deletions

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ leaves implicit — intent, effects, contracts, confidence, refusal — and
1515
preserves those codifications with **fidelity** across every agent that reads,
1616
writes, or composes the code. The name is the thesis.
1717

18+
Codifide is a **contract-and-dispatch language**, not a systems language or a
19+
general-purpose computation language. It optimizes for declaring intent and
20+
contracts, dispatching among candidates, enforcing effects, and
21+
content-addressing compositions — the properties that matter for
22+
agent-to-agent trust.
23+
1824
## Thesis
1925

2026
Every mainstream programming language — from Fortran to Rust — was designed

codifide/__main__.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,12 @@ def _check_publicsite_sync(repo_root: "Path", gaps: list) -> None:
786786
"file not found in publicsite directory"
787787
)
788788

789-
# PS-3 — version stat in index.html
790-
index_html = publicsite / "index.html"
791-
if index_html.exists():
789+
# PS-3 — version stat in language.html (or index.html fallback)
790+
# The version stat moved to the dedicated language page in the site
791+
# restructure (May 2026). Check language.html first, fall back to index.html.
792+
lang_html = publicsite / "language.html"
793+
check_html = lang_html if lang_html.exists() else (publicsite / "index.html")
794+
if check_html.exists():
792795
try:
793796
from .capability import generate_capability
794797
live_generator = generate_capability().get("generator", "")
@@ -798,7 +801,7 @@ def _check_publicsite_sync(repo_root: "Path", gaps: list) -> None:
798801
m = _re.search(r"codifide-python-(\d+)\.(\d+)", live_generator)
799802
if m:
800803
expected_stat = f"v{m.group(1)}.{m.group(2)}"
801-
html = index_html.read_text(encoding="utf-8")
804+
html = check_html.read_text(encoding="utf-8")
802805
# Match the lang-stat-num span that is immediately followed
803806
# by a lang-stat-label containing "released" — that's the
804807
# version stat, not the test count or implementation count.
@@ -811,13 +814,13 @@ def _check_publicsite_sync(repo_root: "Path", gaps: list) -> None:
811814
actual_stat = stat_m.group(1).strip()
812815
if actual_stat != expected_stat:
813816
gaps.append(
814-
f" STALE publicsite/index.html: "
817+
f" STALE publicsite/{check_html.name}: "
815818
f"version stat shows '{actual_stat}' but current release is '{expected_stat}'. "
816-
f"Update the lang-stat-num span paired with 'released May 20XX' in index.html."
819+
f"Update the lang-stat-num span paired with 'released May 20XX'."
817820
)
818821
else:
819822
gaps.append(
820-
" MISSING publicsite/index.html: "
823+
f" MISSING publicsite/{check_html.name}: "
821824
"could not find version stat span (lang-stat-num paired with 'released') "
822825
"to verify version"
823826
)
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Parking Sign Confidence Classifier — Example Program
2+
3+
**Date:** 2026-05-17
4+
**Persona:** Quill
5+
**Gate:** Fast-track G0/G1/G4 (< 1 day, no interpreter changes, example program only)
6+
7+
---
8+
9+
## What happened
10+
11+
Douglas asked what would be a good candidate to write in Codifide, given the
12+
projects in the workspace. The answer was a parking sign confidence classifier
13+
inspired by DecodeTheSign — the iOS app that interprets confusing parking signs
14+
and refuses to guess when confidence is low.
15+
16+
The program was written, tested, and runs correctly on the first attempt (after
17+
one cost-ordering fix for sign type priority).
18+
19+
---
20+
21+
## What shipped
22+
23+
`examples/parking_sign.cod` — a 140-line Codifide program that demonstrates:
24+
25+
1. **Belief dispatch**`gate_ocr` uses `belief()` and `believe` to gate on
26+
OCR confidence. Above 0.85: proceed. Between 0.70–0.85: flag as low
27+
confidence. Below 0.70: refuse with `bottom`.
28+
29+
2. **Cost-based multi-candidate dispatch**`classify_sign_type` has six
30+
candidates ordered by specificity. Street cleaning (cost 1) beats the
31+
generic time-restricted pattern (cost 10) even though both match signs
32+
containing "AM"/"PM".
33+
34+
3. **First-class refusal** — Two refusal paths: `gate_ocr` refuses below
35+
0.70 confidence, and `verdict_for_unknown` refuses on unrecognized sign
36+
types. Both use `bottom "reason"` with explanatory strings.
37+
38+
4. **Contracts** — Preconditions validate confidence range (0.0–1.0) and
39+
non-empty text. The runtime enforces these at every call boundary.
40+
41+
5. **Pure functions throughout** — Every function declares `effects {}`.
42+
No I/O, no model calls. The sign text arrives pre-extracted (simulating
43+
the OCR-to-rule-engine handoff in DecodeTheSign's architecture).
44+
45+
6. **Parallel evaluator opportunity** — The `main` function's `list()`
46+
call contains eight independent sign analyses with no shared state.
47+
48+
---
49+
50+
## Test results
51+
52+
```
53+
$ python3 -m codifide run examples/parking_sign.cod
54+
['NO', 'YES', 'NO', 'NO', 'CONDITIONAL', 'UNKNOWN', True, True]
55+
```
56+
57+
| Input | Confidence | Result | Explanation |
58+
|-------|-----------|--------|-------------|
59+
| "NO PARKING ANY TIME" | 0.95 | NO | Clear prohibition |
60+
| "2 HR PARKING 8AM-6PM EXCEPT SUNDAY" | 0.88 | YES | Metered — you can park |
61+
| "PERMIT PARKING ONLY ZONE 4" | 0.92 | NO | Need permit |
62+
| "NO STOPPING 7AM-9AM MON-FRI" | 0.91 | NO | Clear prohibition |
63+
| "STREET CLEANING TUESDAY 8AM-10AM" | 0.87 | CONDITIONAL | Time-dependent |
64+
| "FREE PARKING ALL DAY" || UNKNOWN | No recognized pattern |
65+
| "blurry text" | 0.45 | ⊥ (bottom) | Refused — confidence too low |
66+
| "maybe no parking?" | 0.72 | ⊥ (bottom) | Refused — low confidence path |
67+
68+
Full test suite: 461 passed, 0 skipped, no regressions.
69+
70+
---
71+
72+
## Design decision: cost ordering
73+
74+
The first attempt used intuitive costs (no parking = 1, time-restricted = 5,
75+
cleaning = 15). This caused "STREET CLEANING TUESDAY 8AM-10AM" to match
76+
`TIME_RESTRICTED` (cost 5, matches "AM") before `STREET_CLEANING` (cost 15).
77+
78+
The fix: order by specificity, not by intuition. More distinctive keywords
79+
get lower costs. The broad "contains AM or PM" pattern gets cost 10 — it's
80+
the catch-all for time-based signs that don't match a more specific category.
81+
82+
This is the Codifide idiom working as designed: cost annotations let you
83+
express "prefer the more specific match" without complex guard logic.
84+
85+
---
86+
87+
## Connection to DecodeTheSign
88+
89+
The program models the same decision architecture as DecodeTheSign's rule
90+
engine:
91+
- OCR confidence gating (FR-001 acceptance criterion 5: refuse below threshold)
92+
- Sign type classification (FR-002: evaluate rules by type)
93+
- Conservative refusal (the app's core philosophy: never guess)
94+
95+
The difference: DecodeTheSign's real engine is time-aware (evaluates against
96+
current time, handles midnight-wrapping windows, 30-minute SOON threshold).
97+
This Codifide version is a static classifier — it demonstrates the confidence
98+
and dispatch patterns without the clock dependency.
99+
100+
---
101+
102+
## What I'm not yet sure of
103+
104+
Whether the `else if` chaining in `interpret_sign` is the most idiomatic
105+
Codifide pattern. An alternative would be six separate candidates on
106+
`interpret_sign` itself, each guarded by `eq(classify_sign_type(text), "X")`.
107+
That would be more graph-native but would call `classify_sign_type` six times
108+
(once per guard). The current approach calls it once and branches. Both are
109+
valid; the language doesn't yet have a "match" construct that would make this
110+
cleaner.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
dispatch:
2+
id: sha256:pending
3+
schema: codifide.dispatch/0.1
4+
subject: "Parking sign confidence classifier — example program"
5+
at: "2026-05-17T00:00:00Z"
6+
author: Glyph
7+
intent: >
8+
Record the creation of examples/parking_sign.cod — a domain-specific
9+
example inspired by DecodeTheSign that demonstrates belief dispatch,
10+
cost-based multi-candidate classification, first-class refusal, and
11+
contracts. Fast-track gate (no interpreter changes, example only).
12+
13+
state:
14+
shipped:
15+
- "examples/parking_sign.cod: 140-line parking sign classifier"
16+
- "gate_ocr: belief dispatch with three-tier confidence gating (0.85/0.70/bottom)"
17+
- "classify_sign_type: 6-candidate cost-based dispatch for sign classification"
18+
- "interpret_sign: main dispatch combining OCR gate + type classification + verdict"
19+
- "First-class refusal on low confidence (bottom with reason string)"
20+
- "First-class refusal on unrecognized sign types"
21+
- "Contracts: confidence range validation, non-empty text preconditions"
22+
- "All functions pure (effects {})"
23+
- "Program runs correctly: python3 -m codifide run examples/parking_sign.cod"
24+
- "461 tests passing, 0 skipped, no regressions"
25+
in_flight: []
26+
blocked: []
27+
refused:
28+
- "Time-aware evaluation (clock dependency): out of scope for this example"
29+
- "Real OCR integration (model.vision effect): simulated with belief() primitive"
30+
31+
evidence:
32+
- claim: "Program runs and produces correct output"
33+
kind: run
34+
source: "python3 -m codifide run examples/parking_sign.cod"
35+
result: "['NO', 'YES', 'NO', 'NO', 'CONDITIONAL', 'UNKNOWN', True, True]"
36+
confidence: 1.0
37+
- claim: "461 tests passing, no regressions"
38+
kind: run
39+
source: "python3 -m pytest tests/ -q --tb=short"
40+
result: "461 passed in 31.49s"
41+
confidence: 1.0
42+
- claim: "Low confidence OCR correctly refuses (bottom)"
43+
kind: run
44+
source: "is_bottom(gate_ocr('blurry text', 0.45)) in main output"
45+
result: "True"
46+
confidence: 1.0
47+
- claim: "Cost-based dispatch prefers specific patterns over broad ones"
48+
kind: run
49+
source: "STREET CLEANING sign matches STREET_CLEANING (cost 1) not TIME_RESTRICTED (cost 10)"
50+
result: "CONDITIONAL (correct)"
51+
confidence: 1.0
52+
- claim: "Belief dispatch gates on confidence thresholds"
53+
kind: run
54+
source: "gate_ocr with 0.72 confidence returns LOW_CONFIDENCE, interpret_sign refuses"
55+
result: "is_bottom returns True"
56+
confidence: 1.0
57+
58+
unknowns:
59+
- question: "Is else-if chaining the most idiomatic pattern for multi-branch dispatch in Codifide?"
60+
why_unknown: "Alternative: six candidates on interpret_sign guarded by classify result. Trade-off is repeated classification calls vs. single-call branching."
61+
how_to_resolve: "Gather feedback from agent case studies — which pattern do agents reach for naturally?"
62+
- question: "Should this example be extended with clock effects for time-aware verdicts?"
63+
why_unknown: "Would demonstrate effects and stdlib integration but increases complexity beyond the core confidence/dispatch demonstration"
64+
how_to_resolve: "User feedback — does Douglas want a v2 with time awareness?"
65+
66+
next:
67+
- action: "Consider adding parking_sign.cod to the agent case study task set"
68+
depends_on: []
69+
effect: "{}"
70+
- action: "Optionally extend with clock.now for time-aware SOON verdicts"
71+
depends_on: ["user feedback"]
72+
effect: "{implementation}"
73+
74+
links:
75+
canonical: "dispatches/2026-05-17-parking-sign-classifier.yaml"
76+
human_readout: "dispatches/2026-05-17-parking-sign-classifier.readout.md"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Session Close — May 17 2026
2+
3+
**Date:** 2026-05-17
4+
**Persona:** Quill
5+
6+
---
7+
8+
## Session summary
9+
10+
Site restructure session. Repositioned the Codifide Programming Language
11+
and Agentic Stage-Gate Governance on codifide.com based on revenue
12+
potential and clearer product positioning.
13+
14+
**Shipped this session:**
15+
16+
- Created dedicated `/language` page for the Codifide Programming Language
17+
(hero, thesis, six pillars, positioning, stats, code examples, quickstart)
18+
- Restructured homepage: Governance project promoted to featured card (top),
19+
CPL reduced to a standard card with logo, bullet list, and link to `/language`
20+
- Added "Language" to site nav, removed Glossary/Stats from nav (kept in footer)
21+
- Fixed orphaned stats strip that was rendering unstyled between hero and projects
22+
- Fixed nav wrapping — reduced to 6 items + Contact, added `flex-wrap: nowrap`
23+
- Created Codifide Health wordmark SVG (hexagon + shield/cross + pulse line)
24+
- Added Health logo to the Health project card
25+
- Updated CPL README.md with "contract-and-dispatch language" positioning
26+
- Updated `dispatch-check` PS-3 to look at `language.html` instead of `index.html`
27+
for the version stat (since it moved to the dedicated page)
28+
- Added `/language` rewrite to `vercel.json`
29+
- Deployed 4 times to production (iterative fixes)
30+
31+
**Self-hosting analysis:**
32+
- Concluded that Codifide v4.0 cannot self-host — it's a contract-and-dispatch
33+
language, not a general-purpose computation language. Missing: general data
34+
structures, iteration, mutable state, deep recursion, error recovery.
35+
- This is by design, not a failure. SQL can't implement its own query planner either.
36+
- The better question: can an agent self-*manage* using the store and RPC API? Yes.
37+
38+
**Test count:** 461 passing, 0 skipped.
39+
40+
**dispatch-check:** exits 0 (after this close pair).
41+
42+
## What I'm not yet sure of
43+
44+
Whether the Governance-first positioning will resonate with visitors who arrive
45+
expecting a programming language company. The launch banner still says "v4.0 is out"
46+
which might create confusion if the first thing they see is a governance framework.
47+
May need to revisit the banner copy.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
id: 2026-05-17-session-close
2+
date: 2026-05-17
3+
persona: Glyph
4+
kind: session-close
5+
title: "Session Close — May 17 2026"
6+
status: closed
7+
tests: 461
8+
skipped: 0
9+
dispatch_check: exits 0
10+
items_this_session:
11+
- Dedicated /language page for CPL (full content moved from homepage)
12+
- Homepage restructure — Governance featured first, CPL as standard card
13+
- Nav cleanup — 6 items + Contact, no wrapping
14+
- Orphaned stats strip removed from homepage
15+
- Codifide Health wordmark SVG created
16+
- Health logo added to Health project card
17+
- CPL README updated with contract-and-dispatch positioning
18+
- dispatch-check PS-3 updated to check language.html
19+
- vercel.json /language rewrite added
20+
- 4 production deploys (iterative fixes)
21+
- Self-hosting analysis (conclusion: not viable by design, not a failure)
22+
open_items:
23+
- Launch banner copy may need revision (says v4.0 but governance is now featured)
24+
- PyPI publish still pending
25+
- Blob store write API verification still pending
26+
- Governance project logo (matching wordmark style) not yet created

0 commit comments

Comments
 (0)