Repository navigation
CI: fail when the engine names a specific application - #1749
Conversation
Audit every place the engine (packages/flow/openadapt_flow) names a specific application, bucketed as example, data, harness in the package, or real special-casing: docs/GENERALITY_AUDIT.md. Move openadapt_flow/benchmark and openadapt_flow/instrument to packages/flow/benchmark/harness (import benchmark.harness). The wheel packages only openadapt_flow, so it no longer ships them. The benchmark command loads the harness from a source checkout and says so from a wheel; instrument already failed to import from a wheel. Reword two comments that named an app on a generic branch.
scripts/check_engine_generality.py scans openadapt_flow/ for the application names and app-specific identifiers in scripts/generality.toml. app_profiles/ is data and passes; OpenAdapt's demo modules may name the demo app; a comment line may give an example under '# example:'. Hits that predate the check are counted in generality_baseline.json, which only shrinks: a rise fails, and so does a fall the baseline doesn't record. Runs in the flow lint job. CONTRIBUTING documents the rule: app knowledge lives in profiles, contracts and fixtures.
Audit every place the engine (packages/flow/openadapt_flow) names a specific application, bucketed as example, data, harness in the package, or real special-casing: docs/GENERALITY_AUDIT.md. Move openadapt_flow/benchmark and openadapt_flow/instrument to packages/flow/benchmark/harness (import benchmark.harness). The wheel packages only openadapt_flow, so it no longer ships them. The benchmark command loads the harness from a source checkout and says so from a wheel; instrument already failed to import from a wheel. Reword two comments that named an app on a generic branch.
22de5f6 to
7d884c0
Compare
A comment that landed on main named the lab's Patient Notes app beside a tolerance; the guard caught it. The example marker also accepts '#:' doc-comments.
The wheel ships only the engine (see packages/flow/docs/GENERALITY_AUDIT.md). Moved out of openadapt_flow: - integrations/harness2 -> benchmark/harness/harness2 (the harness2 extra is dropped; install [browser] beside Harness² from a checkout) - mockloan/ and demo_driver.record_disbursement_demo -> benchmark/harness/mockloan/ (recorder in demo.py) - guard_demo.py -> benchmark/harness/guard_demo.py - agent/ledger_demo.py -> packages/agent/tests/ledger_demo.py - mockmed/teach_scope.py -> packages/flow/tests/_teach_scope.py - learning/synth_stream.py: StructuralDiffInducer -> learning/induce.py; the MockMed drift stream -> benchmark/harness/synth_stream.py reward/seed.py is split: the bundle helpers (write_bundle, calibrate_bundle, self_signed_certificate) are now reward/bundle.py. The MockMed seed stays, because serve-reward --seed-mockmed needs it from a wheel.
…move-harnesses # Conflicts: # packages/flow/CHANGELOG.md # packages/flow/docs/GENERALITY_AUDIT.md # packages/flow/tests/test_lending_swer.py
…e-harnesses # Conflicts: # packages/flow/CHANGELOG.md # packages/flow/benchmark/harness/run_benchmark.py # packages/flow/docs/GENERALITY_AUDIT.md # packages/flow/openadapt_flow/__main__.py # packages/flow/pyproject.toml # packages/flow/tests/test_lending_swer.py # packages/flow/tests/test_runtime_never_imports_benchmark.py
…ity-guard # Conflicts: # .github/workflows/packages.yml # packages/flow/CHANGELOG.md # packages/flow/benchmark/harness/run_benchmark.py # packages/flow/docs/GENERALITY_AUDIT.md # packages/flow/openadapt_flow/__main__.py # packages/flow/pyproject.toml # packages/flow/tests/test_runtime_never_imports_benchmark.py
…ging and import-guard lines
…pend lost in the main merge
Independent review (AI, adversarial)Verdict: changes needed (at 10e3734) Blocking
Non-blocking
Checked and fine
Response (5e3742e and the follow-up that undoes an unrelated scripts/ reformat)
Guard tests: 10 passed. |
Independent re-review (AI) at 8a01ffeVerdict: looks good. Nothing blocking is left.
Two new minor findings:
Response (88eaf68)
Guard tests: 10 passed. |
Signed-off-by: abrichr <richard.abrich@mldsai.com>
…into agent/97 Signed-off-by: abrichr <richard.abrich@mldsai.com> # Conflicts: # packages/flow/CHANGELOG.md # packages/flow/docs/GENERALITY_AUDIT.md
Signed-off-by: abrichr <richard.abrich@mldsai.com>
|
Updated to cdf9c99 after #1760. The baseline is now 358 (from 425), including the retained MockLoan server; three unchanged moved identifiers retain their exact existing allowances. Two prose examples became generic. No checker or denylist changes. All 10 guard tests pass; Flow Ruff/format and mypy pass. A separate current-main scan with only the prose edits also has no new or stale entries. The branch was fast-forwarded, without force-pushing. Please review the baseline refresh. |
Independent adversarial review: APPROVEFrom: Grok. Reviewed head cdf9c99. The branch's merge-base (b21a86d) is behind main, so a plain
No tests are deleted or weakened. reward/ is identical to main. What I checked, all on the merged tree:
Non-blocking gaps (follow-ups, not blockers):
All probe files were removed afterwards. The worktree is back at cdf9c99 and clean. The coordinator's two questions:
|
Signed-off-by: abrichr <richard.abrich@mldsai.com>
|
Current main is now a parent at f7a173b, via a plain merge without force-pushing. The diff against main is exactly 15 guard/prose files (+711/-14); already-merged benchmark/results files are gone. The reviewed checker, denylist and 358-hit baseline are unchanged. After integration: 62 guard/reward/environment tests pass, Flow Ruff/format pass, and mypy passes (588 files). CI is running. |
The Flow lint job now rejects new application names and app-specific identifiers in the engine. Application data and the existing demo-module exceptions stay explicit in
scripts/generality.toml; all other existing hits form a per-file, per-term ratchet that can only shrink. CONTRIBUTING explains where application knowledge belongs.After #1760, the baseline falls from 425 to 358 hits, including the MockLoan server retained for installed OpenEnv use. Three unchanged identifiers moved from
reward/seed.pytoreward/bundle.py; their existing allowances moved with them. Two newer prose examples now use generic names. The checker, denylist and safety tests are unchanged.Tested: 10 guard tests; Flow Ruff and formatting checks (1307 files); mypy (585 files). A separate scan of current main (9ee6030) with only the seven comment/docstring edits reports no new or stale entries. No application or lab run was needed.
Updated head: f7a173b. The two local documentation conflicts preserve every changelog entry and the guard PR's updated audit paragraph. The existing PR branch was fast-forwarded without force-pushing.
Current main (3d6b0b1) is now a parent of the branch. The diff against main is only the 15 guard/prose files (+711/-14); already-merged benchmark/results files are absent. Validation after this integration: 62 guard/reward/environment tests pass; Flow Ruff/format pass (1312 files); mypy passes (588 files). The reviewed checker, denylist and 358-hit baseline are unchanged.