Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
8052872
feat(simulate): pr-flow scenario + CLI + contract tests for D/A/G/E (…
noahgift Oct 18, 2026
934368a
feat(simulate): repo-flow scenario (SIM-6): conflict step, optional m…
noahgift Oct 18, 2026
80146dd
feat(simulate): course-flow scenario (SIM-7), CLI surface pins pr-flo…
noahgift Oct 18, 2026
8c92973
feat(simulate): pr-flow --json prints the cycle-record sim block; --r…
noahgift Oct 18, 2026
d5ed110
feat(simulate): fractional N and measured-input overrides (--cap --bu…
noahgift Oct 18, 2026
65daf41
feat(simulate): pr-flow --pr-min --mq-min --p-red --pr-setup measured…
noahgift Oct 18, 2026
2585f50
feat(simulate): pr-flow --observed-24h --src-runs; sim block labels m…
noahgift Oct 18, 2026
356c9b2
test(simulate): SIM-3 pr-flow contract through the binary (bands, Lit…
noahgift Oct 18, 2026
07b98fb
feat(simulate): SIM-2 pr-flow --params (arbiter per-repo params -> ac…
noahgift Oct 18, 2026
3efbce5
test(simulate): course_flow batch wait inside WIP, reported, Little w…
noahgift Oct 18, 2026
776e8f6
feat(simulate): binding_station = argmin of cap/supply/pool bounds, n…
noahgift Oct 18, 2026
2d3857f
feat(simulate): course_flow counts the daily batch wait inside WIP an…
noahgift Oct 18, 2026
65d09ce
feat(contracts): course-flow-batch-wip-v1, Little with the daily huma…
noahgift Oct 18, 2026
793ef37
feat(simulate): t_rev_min review wait + --t-rev flag (default 0); add…
noahgift Oct 18, 2026
dfb2076
feat(simulate): report simulated author busy fraction rho_a beside th…
noahgift Oct 18, 2026
df1f33e
Merge remote-tracking branch 'origin/main' into feat/sim67-b5b6
noahgift Oct 18, 2026
8f0a28d
feat(simulate): review station in pr-flow: serial or concurrent with …
noahgift Oct 18, 2026
f8de14e
fix(simulate): flow model eq 7 law block in pr-flow --json; merge-que…
noahgift Oct 18, 2026
b9931f2
Merge feat/sim67-b5b6 (SIM-6/7, B6) into feat/5511-sim-pr-flow
noahgift Oct 18, 2026
461bf9e
fix(contracts): declare sim pr-flow, repo-flow, course-flow in apr-cl…
noahgift Oct 18, 2026
7837481
fix(contracts): course-flow-batch-wip declares falsification_tests (S…
noahgift Oct 18, 2026
0ecee41
fix(contracts): course-flow-batch-wip falsification ids FALSIFY-001..…
noahgift Oct 18, 2026
b60e404
test(simulate): course_flow Content Factory v2 falsifiers, stage at e…
noahgift Oct 18, 2026
1f1d170
feat(simulate): course_flow Content Factory v2, fan-out, rework, GPU …
noahgift Oct 18, 2026
4c0a876
chore(contracts): regen contracts.nt and README count for course-flow…
noahgift Oct 18, 2026
feeacc4
chore(contracts): regenerate pv-sat witness for the course-flow-conte…
noahgift Oct 18, 2026
7cab355
Merge origin/main into batch/b5-content-factory-on-5559 (#5559 landed…
noahgift Oct 19, 2026
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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ publishing — all backed by YAML provable contracts that fail CI on drift.
| Metric | Count | Source of truth |
|-------:|------:|---|
| Workspace crates | **81** workspace crates | `cargo metadata --no-deps` (NOT `ls crates/` — 4 are `exclude`d, 1 has no Cargo.toml) |
| Provable contracts | **<!-- CONTRACT_COUNT_START -->1984<!-- CONTRACT_COUNT_END -->** provable contracts | `contracts/census.json` `.n_files` — the set `pv lint` walks (`pv census`, ONT-001 ONT-1; regenerated by `make contracts`, written by `make readme-sync`, guarded by `scripts/check_readme_claims.sh`) |
| Provable contracts | **<!-- CONTRACT_COUNT_START -->1985<!-- CONTRACT_COUNT_END -->** provable contracts | `contracts/census.json` `.n_files` — the set `pv lint` walks (`pv census`, ONT-001 ONT-1; regenerated by `make contracts`, written by `make readme-sync`, guarded by `scripts/check_readme_claims.sh`) |
| CLI commands | **113** CLI commands | `contracts/apr-cli-commands-v1.yaml` §`commands` (parse the list; `apr --help` also lists `help` itself, and `grep -c '^ - name:'` gives 119 — other same-indent `name:` keys exist in the file) |
| Book CLI chapters | **114** chapters | `ls book/src/cli/*.md` |
| Book lib chapters | **73** chapters | `ls book/src/lib/*.md` (parity with `pub mod`) |
Expand Down Expand Up @@ -403,7 +403,7 @@ falsification_tests:
prediction: apr validate bad-model.apr exits non-zero
```

The tree carries <!-- CONTRACT_COUNT_START -->1984<!-- CONTRACT_COUNT_END --> contracts across inference, training, quantization, attention, FFN,
The tree carries <!-- CONTRACT_COUNT_START -->1985<!-- CONTRACT_COUNT_END --> contracts across inference, training, quantization, attention, FFN,
tokenization, model formats, CLI safety — and this README itself.

## Migration from old crates
Expand Down
9 changes: 8 additions & 1 deletion contracts/contracts.nt
Original file line number Diff line number Diff line change
Expand Up @@ -9716,6 +9716,13 @@
<https://ont.paiml.dev/v1alpha1/contract/course-flow-batch-wip-v1> <https://ont.paiml.dev/v1alpha1/id> "course-flow-batch-wip-v1"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-batch-wip-v1> <https://ont.paiml.dev/v1alpha1/name> "course-flow-batch-wip"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-batch-wip-v1> <https://ont.paiml.dev/v1alpha1/version> "1.0.0"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/prov#Entity> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://ont.paiml.dev/v1alpha1/Contract> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://ont.paiml.dev/v1alpha1/Kernel> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <https://ont.paiml.dev/v1alpha1/file> "contracts/course-flow-content-factory-v2-v1.yaml"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <https://ont.paiml.dev/v1alpha1/id> "course-flow-content-factory-v2-v1"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <https://ont.paiml.dev/v1alpha1/name> "course-flow-content-factory-v2"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/course-flow-content-factory-v2-v1> <https://ont.paiml.dev/v1alpha1/version> "1.0.0"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/contract/cpp-type-preservation-v1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/prov#Entity> .
<https://ont.paiml.dev/v1alpha1/contract/cpp-type-preservation-v1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://ont.paiml.dev/v1alpha1/Contract> .
<https://ont.paiml.dev/v1alpha1/contract/cpp-type-preservation-v1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://ont.paiml.dev/v1alpha1/Kernel> .
Expand Down Expand Up @@ -23389,6 +23396,7 @@
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/apr-cli/"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/apr-cli/Cargo.toml"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/aprender-compute"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/aprender-compute/"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/aprender-contracts-cli/"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/aprender-contracts-macros/"^^<http://www.w3.org/2001/XMLSchema#string> .
Expand All @@ -23413,7 +23421,6 @@
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "crates/aprender-train/"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "docs/BEATS.md"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "docs/specifications/aprender-monorepo-consolidation.md"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "docs/ssc-training-status-2026-03-22.md"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "scripts/apr_bin.sh"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "scripts/bump-version.sh"^^<http://www.w3.org/2001/XMLSchema#string> .
<https://ont.paiml.dev/v1alpha1/llm/claude-md> <https://ont.paiml.dev/v1alpha1/llm/referencedPath> "scripts/check_clippy_current_stable.sh"^^<http://www.w3.org/2001/XMLSchema#string> .
Expand Down
85 changes: 85 additions & 0 deletions contracts/course-flow-content-factory-v2-v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
metadata:
version: "1.0.0"
created: "2026-10-18"
author: PAIML Engineering
registry: true
references:
- "Little, J.D.C. (1961), A Proof for the Queuing Formula L = lambda W."
- "Denning, P.J. and Buzen, J.P. (1978), The Operational Analysis of Queueing Network Models (utilization and forced flow laws)."
- "flow model spec, internal (eqs 1, 2, 3, 5, 6, 14)"
description: "course_flow Content Factory v2: fan-out to three renditions, rework loop, GPU priority, build work vs elapsed"

name: course-flow-content-factory-v2
version: "1.0.0"
scope: "crates/aprender-simulate/src/scenarios/course_flow.rs"

description: |
Content Factory v2 is opt-in on CourseFlowConfig; the defaults reproduce the
original course_flow model. With fan_out, every master fans out to R = 3
renditions with no split, so every course takes the staging lanes and the
stage busy fraction meets the utilization law. A rework loop sends a share
alpha of masters back to build, so build carries B / (1 - alpha) passes a day.
The GPU serves the trunk first while the recent course W exceeds a threshold,
else Shorts, and carries LinkedIn feed renders beside the Shorts. Build work
time (holds a builder; sizing) is split from build elapsed time (lead time).

equations:
fan_out_forced_flow:
description: "launches per day = B * R with R = 3 (flow model eq 3)"
formula: "launches_per_day = 3 * courses_per_day"

stage_utilization:
description: "stage busy = B * t_sc / (1440 * lanes) = 5 * 360 / (1440 * 2) = 0.625 (flow model eq 6)"
formula: "|stage_util - B * t_sc / (1440 * lanes)| <= 0.02"

rework_build_utilization:
description: "build busy = B * t_b / (1440 * N_b) / (1 - alpha); at alpha = 0.16 that is 0.795 / 0.84 <= 0.95 (flow model eqs 2, 14)"
formula: "util_build <= 0.95 and |util_build - 0.795 / (1 - alpha)| <= 0.02"

gpu_utilization:
description: "GPU busy = (B * t_g + (B * k + 4) * t_v) / 1440 (flow model eq 5)"
formula: "|util_render - (B * t_g + (B * k + 4) * t_v) / 1440| <= 0.02"

gpu_priority_rule:
description: "trunk first while the recent course W > threshold, else Shorts; the rule reorders and cannot add GPU minutes"
formula: "pick(render) = course iff W_recent > w_threshold"

build_work_vs_elapsed:
description: "a builder holds t_b_work (sizing); lead time carries t_b_elapsed (flow model eqs 1, 2)"
formula: "util_build = B * t_b_work / (1440 * N_b) and dW = t_b_elapsed - t_b_work"

falsification:
- id: FALSIFY-COURSE_FLOW_CF_V2_001
description: "the stage busy fraction matches the eq 6 law 62.5% within 2 points under fan-out"
test: "coursera_stage_matches_the_law_within_two_points in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"

- id: FALSIFY-COURSE_FLOW_CF_V2_002
description: "at alpha = 0.16 build busy is at most 95% and within 2 points of 0.795 / (1 - alpha)"
test: "rework_at_alpha_016_keeps_build_at_or_under_95_percent in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"

- id: FALSIFY-COURSE_FLOW_CF_V2_003
description: "fan-out launches three renditions per master; the legacy split launches one"
test: "fan_out_launches_three_renditions_per_master in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"

- id: FALSIFY-COURSE_FLOW_CF_V2_004
description: "the GPU serves the trunk first only while W is over the threshold, and only on the GPU"
test: "gpu_serves_trunk_first_only_while_w_is_over_the_threshold in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"

- id: FALSIFY-COURSE_FLOW_CF_V2_005
description: "GPU busy matches the eq 5 law with Shorts and four LinkedIn feed renders a day"
test: "gpu_carries_trunk_shorts_and_four_linkedin_renders in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"

- id: FALSIFY-COURSE_FLOW_CF_V2_006
description: "build work sizes the station; build elapsed beyond work moves lead time, not build busy"
test: "build_work_sizes_the_station_and_elapsed_drives_lead_time in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"

- id: FALSIFY-COURSE_FLOW_CF_V2_007
description: "the v2 inputs round-trip through the ledger inputs and the sim block"
test: "v2_inputs_round_trip_through_the_ledger_and_sim_block in crates/aprender-simulate/src/scenarios/course_flow.rs"
evidence: "cargo test -p aprender-simulate --lib course_flow"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"census_id_set_sha256": "7597b4ad189f534dd58cda55c9b1fe29e6339ddb77fd5f40969b4a028eed8f88",
"census_id_set_sha256": "1ff4f1bffcb59d87af86465a6fb83b5959988801194fa4436da56a73b2c62b8e",
"relations_sha256": "811c78184eb2609244c59534f015f0be2f90923120a3027c176ad56723d0d850",
"reasoner_git_sha": "461bf9ef1921a8fbea4bc338f21b566ec342a95e",
"reasoner_git_sha": "4c0a87672d499188eb59bc4ea6969dfdc8beff45",
"checkable_n": 87,
"result": {
"kind": "model",
Expand Down
Loading
Loading