Audit D: compile_time, coarray, persistent_worker, test_environment, ui_layer policies¶
Audited 2026-10-21 against the working tree at fd5b5bc8e (+ the two dirty cftc files, which no finding touches).
Read-only. Scratch files of this audit (scans, generated lookup, audit JSON) are in the same scratchpad directory, prefix D_.
Checks that pass today: scripts/check_test_registry.py . --verbose (37 selectors, 46 programs, 19 registry rows: consistent), scripts/check_descr.py, scripts/check_flex_dag.py.
doc/policies/compile_time_policy.md (lines 206; last commit 2026-10-04; verdict: minor drift; the rules are right, the code does not follow several and nothing checks them)¶
- [L][DRIFT] L6: "A clean build compiles about 840 sources." -> now: 907 compile commands with tests (813 .f90, 81 .F90, 13 C/C++), 736 without (
build/compile_commands.json, configured today). Fix: "about 900 compiles with the tests, about 740 without". - [M][DRIFT] L39-41: umbrellas named are
simple_core_module_api,simple_commanders_api. -> alsosimple_stream_api,simple_pftc_srch_api(32 importers),simple_ori_api(12),simple_ui_modules(32,src/main/ui/simple_ui_modules.f90),simple_gui_metadata_api. Fix: name them all, or define "umbrella" as any module whose body is mostlyuselines and list them in one sentence. - [M][CONTRADICTS] L94-96: "Existing umbrellas stay as they are (see "What does not work")." -> that table has no umbrella row (dangling reference). The rule is also weaker than
.github/skills/simple-main-apis/SKILL.md("do not widen the existing umbrellas ... (doc/policies/compile_time_policy.md)") and thanlayering_and_project_ownership_policy.mdsection 2 ("compile_time_policy.md forbids widening the umbrella"); CLAUDE.md says only "no new umbrella modules or re-exports". Fix: "Do not add names to an existing umbrella and do not import one in new code. A module an umbrella re-exports withoutonly:(simple_defs,simple_type_defs,simple_default_clines,simple_qsys_funs, ...) widens it whenever it gains a public name." - [M][STALE] L104-107: "One library target for SIMPLE." ->
src/CMakeLists.txt:185-212builds a second static library${SIMPLE_COARRAYLIB}from all sources whenUSE_COARRAYS=ON;production/CMakeLists.txt:49-59links onlysimple_private_execto it. Also three always-run custom targets the library depends on (simple_args,simple_ui_defaults,simple_git,src/CMakeLists.txt:27,58,61) and ExternalProject targets (cmake/Dependencies.cmake:261,323). Fix: state the coarray exception and why (module files of the two modes must not mix,src/CMakeLists.txt:180-182). - [M][GAP] "Where the time goes": the commit hash is a
parameterof the root module.src/defs/simple_defs.f90:176includesbuild/lib/simple/SimpleGitVersion.h;simple_git(src/CMakeLists.txt:61-68) rewrites it on every build after a new commit; the decompressedbuild/modules/simple_defs.modcontains the current hash (fd5b5bc8). So each commit changes the interface of the module nearly every file imports. Rebuild cascade expected, not measured. Only 6 files use the constant (production/*.f90x5,src/main/commanders/test/simple_test_state_fixture.f90:111). Proposal: rule "no volatile value (commit hash, date, path) as aparameterof a module others import; keep it in a leaf module imported by the executables"; then measure withprofile_build.sh touch/probe. - [M][VIOLATED] L55-59 (large types allocatable): plain
type(cmdline)components: 8 (src/main/strategies/parallelization/simple_refine3D_strategy.f90:75dated 2026-10-13, i.e. after the policy, and :99-103;simple_calc_pspec_strategy.f90:36,49); plaintype(builder): 2 (simple_make_cavgs_strategy.f90:58,69);builderitself holds plainsp_projectandpolarft_calc(src/main/simple_builder.f90:23,28); ifsp_projectandqsys_envcount as heavy aggregates: 8 more plainsp_projectand 13 plainqsys_envcomponents instrategies/parallelization/*.type(parameters)components: 0 (clean). - [L][VIOLATED] L61-63 (no whole-
parameterscopy): 3 sites, all older than the policy:src/main/cavg_quality/simple_cavg_quality_relations.f90:91,src/main/commanders/single/single_commanders_tseries.f90:273,330(a fourth, insrc/main/pca/simple_diff_map_denoise.f90, went with that file on 2026-11-02). - [M][VIOLATED] L77-81 (testers declare large objects
class(T), allocatable): 191 plainparameters(27),builder(13),cmdline(151) locals in*tester*.f90, 51 of them withgit blamedate >= 2026-10-04 (simple_pftc_inplane_tester.f9014,simple_stream_stage_solve3D_tester.f9011 (cmdline),simple_stream_chain_tester.f905);type(stream_stage_initial_analysis) :: stageplain atsimple_stream_stage_initial_analysis_tester.f90:718. Against it: 57+16+18class(T), allocatabledeclarations. The rule names "stage, sieve or similar";cmdlineis named a heavy type in L28-34 but not in L77-81. Fix: say "parameters,builder,cmdlineand every stage". - [M][VIOLATED] L90-93 (
use ..., only:): module-levelusewithoutonly:(intrinsic modules excluded): 768 statements in 481 of 785 source files; in the 592 files changed since 2026-10-01: 546 in 348 files (top:simple_core_module_api146,simple_test_utils96,simple_commanders_api51,simple_defs38,simple_ui_modules32,simple_pftc_srch_api21,json_module15); in the 172 files ADDED since 2026-10-01: 63 in 59 files (simple_test_utils42,simple_core_module_api20,simple_commanders_api2,simple_pftc_srch_api1,simple_ran_tabu1). Examples (new):src/fileio/simple_stack_read_session.f90:11,src/fileio/simple_image_slab.f90:9,src/main/project/simple_eo_partition.f90:7,src/main/pick/simple_segdiam_bin_picker.f90:18,src/main/strategies/search/simple_strategy3D_cont_1jyx_tester.f90:17. Procedure-level bareuse: 51 (42 in changed files). Convention that contradicts the rule: every tester startsuse simple_test_utilsbare. - [M][VIOLATED] L94-95 (no umbrellas in new code): files importing
simple_core_module_api: 278 at 2026-10-04 -> 291 at HEAD (+13); 58 of the 172 new files import it (40 withonly:, which does not remove the build edge);simple_commanders_api60 -> 60;simple_stream_api4 -> 2. The umbrellas themselves did not widen except one name:files_identicaladded to thesimple_fileiolist ofsrc/main/apis/simple_core_api.f90(d3480ae79, 2026-10-08);simple_commanders_api,simple_stream_apiandsimple_pftc_srch_apishrank. - [L][VIOLATED] L97-100 (third-party
only:): bareuse json_module(17 statements, 9 files),json_kinds(8),CPlot2D_wrapper_module(8), e.g.src/main/ui/simple_ui.f90:253,276,301. - [M][GAP] Enforcement. No rule of this policy has a check; see the table in "Cross-cutting gaps". Proposal: a report-only
scripts/check_compile_rules.pywith a committed baseline, run byrun_fast_gate.shnext tocheck_descr.py: (a) plain heavy components, (b) whole-parameterscopies, (c) bare module-levelusein files changed vs. baseline, (d) umbrella imports in files absent from the baseline, (e) plain heavy locals in testers. Counts may fall, not rise. - [L][GAP] Build configuration L112-115:
${ARCH_FLAG}is-march=native(Linux) or-mtune=...(macOS) whenUSE_ARCHOPT=ON; Debug flags differ by platform (cmake/CompilerConfig.cmakeDebug block: macOS-fcheck=bounds,do,mem, Linux-fcheck=all; reason documented only in the CMake comment);--traps/SIMPLE_DEBUG_TRAPS(compile_debug.sh) are in no policy although the fast gate is a Debug gate. - [L][GAP]
scripts/default_audit.py:828-829writessimple_ui_default_values.f90unconditionally (path.write_text), unlikescripts/simple_args_generator.pl(compare, keep). Any touch of a scanned source (src/CMakeLists.txt:35-42globs commanders, exec, stream, params, defs) regenerates and recompiles that 3000-line file. Same-content output would avoid it. - [L][STRUCTURE] L191-206 "Evidence": a dated measurement log (6 rows, 1 dated sentence) in a policy. Rules are justified by it, but it belongs in
doc/refactoring_notes/completed/stream_owned_state_compile_time_report.md(already linked) and the "What does not work" table is the part worth keeping. - [L][DRIFT]
scripts/profile_build.shheader citesdoc/refactoring_notes/planned/contract_submodule_architecture.md, now underrejected/; the policy lists 4 of the script's 6 commands (probe,reportmissing). - CLAUDE.md compile bullets: all five match the policy; no contradiction. Rules in the policy but not in CLAUDE.md: remove never-read state; keep widely declared types small; put state where used (companion module); split leaf test commanders into submodules; name third-party entities; release flags and
-Wno-maybe-uninitialized; bounded-j; the profiling procedure and 5 s keep rule. Also missing from both: umbrellas other than the two named, the coarray library, the commit-hash mechanism.
doc/policies/coarray_execution_policy.md (lines 292; last commit 2026-10-03; verdict: minor drift)¶
All protocol claims (staging keys, command line, image mapping, nimages formula, log names, sync all, qsys_declare_part_finished early return, no this_image() outside the driver) match simple_qsys_ctrl.f90:349-372,707-741, production/simple_private_exec_driver.f90:68-163, simple_qsys_funs.f90:58-66.
- [M][VIOLATED] L67-70 and L222-224: "must not leak into strategy, commander, or domain-level branching". ->
src/main/strategies/search/simple_matcher_ptcl_io.f90:343(ptcl_buffer_budget, added 2026-10-14 in 77a8df9a8) branches onqsys .eq. 'coarray'(coarray like local: node memory, notjob_memory_per_task). Fix: either allow it ("the qsys name may be read to size memory") or move the decision behindqsys_env. - [M][GAP] Section 3: which executables are coarray-enabled.
simple_private_execalone links${SIMPLE_COARRAYLIB}and a separate module directorymodules_coarray(production/CMakeLists.txt:49-59,src/CMakeLists.txt:176-212);simple_exec,simple_stream,single_execstay on the normal library. Consequence a developer needs: coarray constructs live only in code compiled into both libraries under#ifdef USE_COARRAYS(simple_private_exec_driver.f90:71,129), and a source must compile in both modes. Proposal: add to section 3. - [M][GAP] Re-entrancy. One image runs its partitions one after the other in one process (
simple_private_exec_driver.f90:102-107callsrun_private_exec_lineper partition). Module state, the thread count, the random state (params%newreseeds) and memoised tables therefore carry from one partition to the next, unlike a script backend (new process per part). Since the 2026-10-20 rule, moved master steps neither callparams%newnor restore threads. No sentence states the obligation. Proposal in section 7: "a private commander is re-entrant: it releases its module state inkill, and the driver restores threads". - [M][DRIFT] L51-53:
simple_private_exec.f90"detect--coarray, delegate torun_coarray_direct, and otherwise ..." -> it also dispatches--coarray-smoketorun_coarray_smoke(production/simple_private_exec.f90:14-17), the entry thecoarraysCTest platform test andcompile_coarrays.shrun (production/CMakeLists.txtcoarrays). Fix: add the second flag and say it exercises launch plussync allonly. - [L][STRUCTURE] L271-292 "Current Limits And Follow-Up" mixes limits (true) with a design wish (L284-292: "Future cleanup should decide ...", "intended foundation for future coarray reductions"). Keep the limits, drop the wishes (a planned note).
- [L][GAP] Batch failure semantics differ from script backends:
qsys_ctrl%update_queuereturns at once forqsys_coarray(simple_qsys_ctrl.f90:889-892), so the exit-code/liveness path of the other backends does not apply; failure is the aggregateTHROW_HARDofsubmit_coarray_jobs. One sentence in section 8.
doc/policies/persistent_worker_policy.md (lines 327; last commit 2026-10-01; verdict: minor drift; two false statements, four missing contracts)¶
Wire protocol, message values, TCP_BUFSZ, worker arguments, UID, thread-slot rules, shutdown owners match simple_persistent_worker_message_types.f90, simple_persistent_worker_server.f90, production/simple_persistent_worker.f90.
- [H][STALE] L188-191: "batch scheduling watches
JOB_FINISHED*; streaming scheduling watchesEXIT_CODE_JOB_*" ->qsys_ctrl%update_queue(simple_qsys_ctrl.f90:918-936, since 2307ea96f, 2026-10-13) also readsEXIT_CODE_JOB_*in batch mode: a non-zero status marks the part failed (stop_on_failed_parts), and a part without a status is checked for liveness everyJOB_LIVENESS_S=300 s and givenJOB_LOST_EXIT_CODE=254 after two misses (simple_qsys_job_record.f90:20-22,53-54). Fix: rewrite the bullet list: sentinel = success, exit-code file = failure, liveness = loss; the worker server is still not a completion authority. - [M][STALE] L108-114: reuse "only when ... existing worker count is at least the requested value" -> the check is commented out (
simple_qsys_env.f90:279). The enforced checks: server running, same launch backend, andcheck_worker_claim(the requested per-task threads must not exceed the server's threads per worker,:321-324). Fix: delete the worker-count bullet or restore the check; add the claim check. - [M][GAP] Client-only role. L120 mentions
client_onlyin passing. Not stated: parametersworker_server(host:port) andworker_server_nthr(simple_parameters.f90:262,490; inUI_ENVIRONMENT_KEYS), that a process givenworker_serverstarts no workers and no listener (simple_qsys_env.f90:260-299), that its warm-up callback is not registered, and that the stream master hands both to every stage (simple_commanders_stream_p00_master.f90:451,576-579). Today onlydoc/policies/stream/README.md:66-75says it. Proposal: new section "5a Server roles: owner and client" here; stream README then links. - [M][GAP] Warm-up / cooldown autoscaling (
enable_warmup_cooldown,SCALE_UP_COOLDOWN_S=15,SCALE_DOWN_COOLDOWN_S=300,claim_warmup_worker_ids,qsys_env%service_persistent_worker_warmup,warmup_callback,register_warmup_env). L129 names the state, nothing states the contract: only a streaming queue turns it on, reuse never turns it off (simple_qsys_env.f90:281-282; stated only insieving_and_rejection/ptcl_sieve_policy.md:246-249), scale-down sends TERMINATE to an idle worker, the owner process relaunches slots. Proposal: new section in this policy, move the sieve sentence here. - [M][DRIFT] L143-144: "Task selection order is high, normal, low." -> strictly: the normal queue is considered only when the high queue is empty, the low queue only when both are empty (
simple_persistent_worker_server.f90:1015-1022,1031); an undispatchable high task blocks every normal one.stream/README.md:73relies on this. Fix: say so. - [M][GAP] Loss and cancellation limits (section 10 should list them). A persistent-worker task is recorded as "none 0" (
write_job_record); the liveness check cannot see a task on another host than the master (JOB_UNKNOWN,simple_qsys_job_record.f90:7-21,50), so a worker lost on a remote node is waited for; cancel signals the script and children on the master's host only. The fork contract is also unwritten: a forked stage must callforget_inherited_persistent_worker(simple_stream_master_stage.f90:87-92;simple_qsys_env.f90:789-794). Both are instream/restart_policy.md:116-133only. - [L][DRIFT] L63-65: "A qsys name containing
_workeractivates the overlay." -> not withscript=yes(simple_qsys_env.f90:242-244). Theqsys_nameUI choices list no*_workername (simple_ui_params_common.f90:688-689); the accepted names are documented nowhere. - [L][STRUCTURE] Contracts of this backend live in three other policies (
stream/README.md:66-75,stream/restart_policy.md:116-133,ptcl_sieve_policy.md:246-249); this document says it is "the single policy authority". No history or status text found; the structure is good.
doc/policies/test_environment_policy.md (lines 1328; last commit 2026-10-21; verdict: minor drift on facts, rewrite by splitting)¶
Verified correct: tier table and counts (15 fast, 7 library, 19 highlevel, 1 platform = SIMPLE_CTEST_BUDGET 42; provisional-free labels), run_fast_gate.sh order and ctest_budget.py 60 s, fast env (OMP_THREAD_LIMIT=4, OPENBLAS_NUM_THREADS=1, 600 s), sub-suite tables of 13 of 14 areas, suite_id rule, 32-character names, registry rows and check_test_registry.py coverage, seeds (20260923, stride 2654435761), GRACE_S=60, 90 % memory, identity exclusions (word 14, bytes 121-128), CI workflows ci_build.yml/ci_test.yml steps, test_gate/simple_test_truth_metrics routine names, fixture cache key, numeric constants of 8 cards spot-checked.
- [M][STALE] L702:
get_test_seed_offset()-> does not exist;simple_test_utilsexportsset_test_seed_offset,offset_seed,fix_test_seed,set_fixed_seed,enter_fixture,leave_fixture(src/utils/simple_test_utils.f90:16-17). Fix: replace withoffset_seed(base)and add the two fixture helpers to the table. - [M][CONTRADICTS] L596-598: scratch files "named
tmp_<tester>_*and deleted at the end of the test, also when a check failed" -> the shared helperenter_fixture/leave_fixture(simple_test_utils.f90:330-350, 21 testers) makes<tag>_<pid>and KEEPS it when a check failed; 26 testers still usetmp_. Fix: document the helper as the default and the keep-on-failure rule. - [M][DRIFT] L318-320 (
keep_outputs=no): "deletes the subdirectories of each execution's run directory ... as soon as it ends" -> only a passed execution (simple_test_dispatch.f90:81,96-97,325EXEC_PASSED); failed ones keep their outputs. Also L277-280 (known limits) assumes the other reading. - [L][DRIFT] L100-116:
unit_projectrow lists 19 sub-suites, the table has 21 (micrograph subset,particle subsetmissing;suites_project). The whole 1.1 table duplicates whatsimple_test_exec test=<area> suite=listand the generatedtest_inventory.mdprint: a drift magnet. Fix: replace the table by area, scope and one example sub-suite. - [L][DRIFT] L190:
rnd_seed_parameter.md->doc/refactoring_notes/planned/rnd_seed_parameter.md. - [L][DRIFT] L622-626 (
..._<area>.f90): the pipeline-test file families areclass,highlevel,single,streamfor commanders and routers, but the test UI has onlysimple_test_ui_class.f90andsimple_test_ui_highlevel.f90; the 11simple_commanders_test_highlevel_*.f90are submodules ofsimple_commanders_test_highlevel. Fix: name the real files. - [L][DRIFT] L50-52: "the gate takes about 5 s on the reference Mac in Debug" vs
production/CMakeLists.txtcomment "fifteen together 11.6 s ... 24-core test machine, 2026-10-19". Two timings, no definition; a log in a policy. Fix: delete; the budget is 60 s. - [L][VIOLATED] L573-575 (no process control in a tester):
stop "unexpected type"atsrc/utils/structs/simple_linked_list_tester.f90:247,265,273;error stopatsrc/main/volume/simple_pcg_sparse_tester.f90:140. - [L][DRIFT] L679-684:
get_rmat_ptr_padded"is for the one caller" -> callers:simple_image_slab.f90:121,simple_stack_read_session.f90:557, and the testersimple_stack_io_tester.f90:783-784(which the same paragraph forbids). - [M][GAP] Day-to-day commands. Not mentioned anywhere in the policy:
./run_tests.sh [fast|library|highlevel|platform|all|list|TEST](rerun from an existing build, repo root),make check(CMakeLists.txt:124), and the incremental loopmake -C build -j<n>+scripts/run_fast_gate.sh build+make -C build -j<n> installthat CLAUDE.md prescribes. Only the full-rebuildcompile_*.share documented. The three scripts disagree on the budget:run_tests.sh:18"30-second fast gate",run_fast_gate.shheader "30 s wall-time budget",ctest_budget.pyusage text--budget 30, while all pass 60. - [M][GAP] Front-door keys.
seed_offset,target,nseeds,dir1,dir2,keep_outputsare accepted bysimple_test_execonly becausescripts/simple_args_generator.pl(scripts/simple_args_generator.pl:141) lists them by hand; a new front-door key not added there is rejected by the parser. Policy sections 1.4/4.1 do not say. Same trap for UI inputs, see ui_layer U4. - [M][GAP] CLAUDE.md asks to "run the high-level entries a change affects"; no document maps a code area to the entries (and
check_test_registry.pyholds no such column). Proposal: a one-linecovers:field per registry row, printed bytest=list, and one sentence in section 3. - [L][GAP]
compile_debug.sh --traps/SIMPLE_DEBUG_TRAPS, the macOS/Linux difference of Debug checks (cmake/CompilerConfig.cmake), andscripts/run_fast_gate.shstill selectingfast|provisional(noprovisionalentry exists) are not mentioned. - [M][STRUCTURE] Size and content: 1328 lines. Proposed split (line counts of the current sections):
- Keep
test_environment_policy.md(about 600): purpose, tiers and gate (sections 1 intro, 1.3, 1.4), 2, 3.1-3.3, 4, 5. Replace 1.1/1.2 tables by pointers tosuite=list/registry. - New
test_suite_runner_and_gates_policy.md(about 330): 1.5 dispatcher, registry, nightly/profile/identity (L210-345), 6.1-6.3, and the floor rule 6.2 (L754-822). - Move out of policy: 6.5 test cards (L931-1126, 196 lines: profiles, dated medians, wall times, 33 dates and 10 "ruling" mentions in the file; floors are also written next to the checks, so each number lives twice) to
doc/code_overview/or the test sources; 1.2 (L121-145, 25 very long rows duplicating 6.5); 6.6 "Real data (planned)" (L1128-1169) todoc/implementation_notes/planned/testing_and_benchmarking_plan.md(it already cites that plan); 6.4 (L881-929, 49 lines specifying an external repository's workflow) to that repository or to the plan; 7-9 (L1171-1328, 158 lines of history; the 106-line mapping table duplicatesdoc/refactoring_notes/completed/test_review_record.md) to that record, leaving one rule paragraph ("no standalone test programs") in section 3. - 3.4 (L493-554: master-based working, worktrees, push rules, CI badges) is a development-workflow policy, not a test rule (see cross-cutting).
- [L][STRUCTURE] L1-8: dated status line ("records the state after the test-environment refactoring of September 2026"). Delete.
- [L][CONTRADICTS]
production/CMakeLists.txtcomment forlib_cart_align3Dsays "5 000 simulated 1JYX particles"; code and policy say 1 000 (simple_strategy3D_cont_1jyx_tester.f90:43). Policy is right; fix the comment.
doc/policies/ui_layer_policy.md (lines 552; last commit 2026-10-03; verdict: minor drift; the model is current, the status section is false)¶
Verified: field lists of ui_program, ui_program_input, ui_requirement_group, ui_activation; UI_VIS_*; 30-100/40/100 character limits; seven section lists; UI_ENVIRONMENT_KEYS; has_input/accepts; ui_choices validity rules; UI_ALT gone; module-local UI_CATEGORY (incl. the new simple_ui_refine2D.f90: id refine2d, "Refine 2D Workflows", order 30); validate_complete_ui_json (ALL) and validate_/update_stream_ui_contract; NICE migration 0006_rename_programs.py; link to 3D/solve3D_addon_policy.md; default_audit.py generates the lookup from CMake, and its output equals build/lib/simple/simple_ui_default_values.f90.
- [M][STALE] L530-532: "The optional
audit_ui_defaultsreport currently contains no errors or warnings" -> run today (scripts/default_audit.py --ui-executable build/bin/simple_private_exec): 344 diagnostics, 8 errors, 20 warnings. Errors:simple_streamprogramsassign_optics,gen_pickrefs,master,pick_extract,pool2D,preproc,sieve_cavgs,solve3D_stream"could not locate execute method for router case" (the audit'sextract_stream_routesdoes not follow the p00-p07 restructuring). Warnings include the new public program:refine2Dcenlp,lpstart,lpstop"unresolved command-line assignment" andcenter_type,extr_lim,oritype"default rule is not exposed by this UI program" (src/defs/simple_default_clines.f90:30-39), plusclassify3D_refsx5,refine3D oritype,solve2D center_type. Fix: delete the sentence (status) and repairextract_stream_routes; decide whetherrefine2Dexposescenter_type/extr_lim/oritype. - [H][GAP] Private programs.
simple_private_prgs.f90holds the required keys of programs that exist only onsimple_private_exec; a private program that has a public program's name (refine2D,refine3D, ...) is checked against the PUBLIC descriptor bycmdline%parse_private(simple_cmdline.f90:225,266; norefine2D/refine3Drow insimple_private_prgs.f90). Adding a required input or a requirement group to a public program therefore also constrains every worker command line. The newrefine2Dcomment says it (simple_ui_refine2D.f90,new_refine2D), the skillsimple-main-uisays it, the policy does not mentionsimple_private_prgsat all. Proposal: new section "Private programs" with this rule and "the memory estimator keys on the program name" (structure2D report, item 2). - [M][GAP] Scope of the default generator (L56-62 and "Default ownership").
scripts/default_audit.py:842-848readssrc/main/commanders,exec,stream,defs,paramsonly.src/main/strategies(108if (.not. cline%defined(k)) call cline%set(k, v)sites, e.g.set_preprocess_defaultsatsimple_preprocess_strategy.f90:122,simple_motion_correct_strategy.f90:130) andsrc/main/solve(4) are invisible, and a helper called from a commander is traced only if named inTRACED_DEFAULT_HELPERS/DELEGATED_WORKFLOWS(default_audit.py:57,61). The generated lookup has no override set forpreprocess,motion_correct,ctf_estimate,pick,make_cavgs,reextract. Since the 2026-10-20 rule moves bodies out of commanders, defaults moved with them silently fall back to the baseline. Proposal: state the scan scope in "Default ownership" and the rule "a default the UI must show is set in the commander or in a helper listed inTRACED_DEFAULT_HELPERS" (the skill has the second half). - [M][GAP] Accepted keys (L249-250, L493-494). Where the "generated argument vocabulary" comes from is not stated:
scripts/simple_args_generator.plreads thetype(parameters)declarations ofsimple_parameters.f90(lines beforecontains), addsvol1..vol20and a hand-written list (job_memory_per_task,projname,simple_path,time_per_image,user_*,qsys_partition,qsys_qos,qsys_reservation,job_name, the six test front-door keys) and writessimple_args.f90/simple_varlist.txt. A UI input whose key is in neither place is rejected by the parser. The rule "registered inputs = accepted keys" has no check (verified today: 27 UI-registered keys are absent fromsimple_varlist.txtand rely on the hand list; nothing asserts inputs are a subset of the vocabulary). Proposal: add the three-line recipe "new key: parameters field,simple_parameters_parse.f90registration, UI input" and aunit_uicheck. - [L][DRIFT] L135-136: "
ui_hash... supplies typed access toui_programandui_param" -> onlyui_program(simple_ui_hash.f90:1-3). - [L][DRIFT] L141-152: the
ui_paramfield table omitsrequiredandexample_value(simple_ui_param.f90:22,25);example_valuecarries the numeric example of the placeholder. - [L][DRIFT] L347-349: the 100-character ceiling "is enforced by
ui_program%new" ->newenforces 100; both bounds (30 and 100) are enforced for every registered program invalidate_ui_presentation(simple_ui.f90:89-92). - [L][DRIFT] L254-257: "
solve3D_addonis the first such program" ->solve3D_chunksusesacceptstoo (simple_commanders_solve3D_chunks.f90:61,286). - [L][GAP] Group labels: L176-178 says
groupcreates a group with "a plain-English label"; the label comes from a hard-coded table inui_program(simple_ui_program.f90:402-420, unknown ids label themselves). The stream UI keeps the old-name id"cluster 2D"(simple_ui_stream.f90:53-92,simple_ui_program.f90:418) becauseproduction/stream_ui_contract.jsonfixes it. - [L][GAP] How to get the JSON:
simple_exec prg=print_ui_json,simple_private_exec prg=write_ui_json/print_stream_ui_json, thevalidate_ui_jsonsub-suite ofunit_ui, and the three hand-written writers that "are duplicated today" (L512-513:write2json/create_json_entryinsimple_ui_program.f90,print_stream_ui_jsoninsimple_ui.f90:299-508) are not named. Name them so "update all JSON paths" is actionable. - [M][STRUCTURE] L517-553 "Refactor status / Current phase: complete / Deferred review": status narrative inside a policy (eight completed bullets, one false, see first finding); L123 ("
UI_ALTandalt_ioshave been removed") and L296-302 ("Renamed programs") are history mixed with rules. Move the status and removals todoc/refactoring_notes/completed/, keep one rule: "programs are renamed without aliases". - [L][CONTRADICTS] L481-483 "Commit the descriptor changes and
production/stream_ui_contract.jsonin the same commit" vs CLAUDE.md "Never commit or push" (agent rule, not scoped there). Say "the maintainer commits ...".
Counts¶
| doc | H | M | L | total |
|---|---|---|---|---|
| compile_time_policy | 0 | 9 | 7 | 16 |
| coarray_execution_policy | 0 | 4 | 2 | 6 |
| persistent_worker_policy | 1 | 5 | 2 | 8 |
| test_environment_policy | 0 | 7 | 9 | 16 |
| ui_layer_policy | 1 | 4 | 7 | 12 |
| total | 2 | 29 | 27 | 58 |
By category (a finding with two tags is counted once, under its first): STALE 5, DRIFT 16, OLDNAME 0, CONTRADICTS 4, VIOLATED 8, GAP 19, STRUCTURE 6.
Compile-time rules: what checks them¶
Source: the "Rules for day-to-day development", "Measuring" and "Reducing" sections. "Gate" = run_fast_gate.sh; "CI" = .github/workflows (builds with warnings on, no -Werror, no warning count).
| # | rule | check |
|---|---|---|
| 1 | heavy types (parameters, cmdline, stage, sieve, aggregate) are allocatable components, allocated before the constructor, freed in kill on both paths; new/kill symmetric and idempotent |
none (review). Greppable. |
| 2 | no snapshot of parameters |
none (review). Greppable (4 sites). |
| 3 | remove never-read state | partial: -Wall -Wunused finds unused locals and private module variables; scripts/fix_warnings.py (manual) fixes them; write-only components undetected |
| 4 | keep widely declared types small | none (review); profile_build.sh shows the cost afterwards |
| 5 | state used by one submodule is declared there; shared state in a companion module | partial: gfortran "unused private module variable" |
| 6 | testers: class(T), allocatable |
none (review). Greppable. |
| 7 | split leaf test commanders into parent + submodules | none; profile_build.sh tail |
| 8 | use ..., only: and only what the module needs; procedure-level imports local |
none for bare use; stale only: names caught by -Wunused (+ fix_warnings.py) |
| 9 | no new umbrella modules or re-exports; do not widen existing | none |
| 10 | third-party modules imported with only: |
none |
| 11 | one library target | none (review of CMake) |
| 12 | no per-file compile options, fix warnings in code | convention only; the only set_source_files_properties is the vendor -w (src/CMakeLists.txt:125); no -Werror, no CI warning check |
| 13 | Release flags -O3 ${ARCH_FLAG} -fPIC, -Wno-maybe-uninitialized; new global flag needs a benchmark |
encoded in cmake/CompilerConfig.cmake; change is review |
| 14 | bounded job count | enforced by the compile_*.sh scripts via scripts/simple_build_jobs.sh; a hand-run make -j is not |
| 15 | pre-commit builds include tests and gate | enforced by default in the compile_*.sh (gate between make and install); CI runs them nightly |
| 16 | like-for-like profile comparison, 5 s keep rule, single samples | procedure; profile_build.sh compare prints deltas, nothing refuses a bad comparison |
Current violations of the three easiest-to-grep rules (scripts: D_use_scan.py, D_comp_scan.py, D_pcopy.py): see the findings above. Summary: plain heavy components cmdline 8, builder 2, parameters 0; whole-parameters copies 4 (none new); tester plain heavy locals 191 (51 new); bare module-level use 768 in 481/785 files (changed since 2026-10-01: 546 in 348/592; added: 63 in 59/172); umbrella importers simple_core_module_api 291 (+13 since 2026-10-04), new files 58/172.
The 'apis' umbrella modules¶
- Is there a policy statement that new code must not widen them? Partly.
compile_time_policy.mdL94-96 says "Do not add new umbrella modules or re-exports ... Existing umbrellas stay as they are (see 'What does not work')", with a dangling cross-reference; it names two umbrellas. The explicit "do not widensimple_core_module_api,simple_commanders_api,simple_stream_api" is only in the skillsimple-main-apis(and its description). CLAUDE.md: "no new umbrella modules or re-exports".layering_and_project_ownership_policy.md(untracked draft) section 2 says the compile policy "forbids widening the umbrella", which the compile policy does not literally say. - What does the code do? The umbrellas are stable: since 2026-10-04 one name was added (
files_identicaltosimple_core_api.f90, d3480ae79);simple_commanders_api,simple_stream_api,simple_pftc_srch_apilost imports (nice/guistats retirement, solve2D_chunks move,sigma2_binfile). Importers keep growing: core API 278 -> 291 files (58 of 172 new files), commanders API constant at 60,simple_stream_api4 -> 2. Widening can also happen without editing the file:simple_core_module_apiandsimple_commanders_apire-exportsimple_defs,simple_type_defs,simple_defs_conv,simple_defs_fname,simple_defs_stream,simple_default_clines,simple_qsys_funswith noonly:, so every public name added there widens them (and the git hash is one such name).
Cross-cutting gaps in this cluster¶
- Queue-system contract has no home. Completion by sentinel/exit code/liveness (
JOB_FINISHED_*,EXIT_CODE_JOB_*,JOB_LOST_EXIT_CODE),stop_on_failed_parts, cancellation,qsys_declare_part_finished,numlen, the job record,update_queueper backend are described by no queue policy; the coarray and persistent-worker policies each assume "the existing scheduler" and the stream policies hold fragments (stream/restart_policy.md:110-133). No skill coverssrc/utils/qsyseither. Proposal:queue_system_policy.md(common contract) with the two backend policies as deltas. - Development-workflow rules have no policy: "never commit or push" and "preserve dirty worktree" (CLAUDE.md, for agents), "everyone works on master, push after a green
./compile_debug.sh" (test policy 3.4, for maintainers), the incremental build loop and parallel install (CLAUDE.md/memory), and "which tests to run for which change". These conflict in tone unless scoped to actor. Proposal:development_workflow_policy.mdtaking test policy 3.4. - General Fortran source conventions are in the skill
simple-modern-fortranand in the test policy only by accident:!@descr:header and one module per file (enforced bycheck_descr.pyin the gate, documented in test policy 4.1/4.5),new/killsymmetry,THROWmacro traps, comments. A contributor reading policies only never meets them. Proposal: a shortfortran_conventions_policy.mdor a section of the compile policy for the enforced ones. - Generated sources and the accepted-key vocabulary:
simple_args.f90,simple_varlist.txt,simple_ui_default_values.f90,SimpleGitVersion.h,doc/code_overview/{code_base_map,test_inventory}.md(written intodoc/by every build) are described only in skills and CMake comments. Where a new key must be declared (parameters field + parse registration + generator hand list + UI) is in no policy (ui U4, test T11). Proposal: one section "Generated sources" inui_layer_policy.md. - Enforcement is by review everywhere in the compile policy and the coarray/persistent-worker policies; the fast gate has three static checks (registry, headers, FLEX DAG) and the layering draft proposes a fourth. The compile rules need the same treatment (
check_compile_rules.py, report-only, baseline). - The brief's items about the new
layering_and_project_ownership_policy.md(untracked) anddoc/policies/README.md(untracked): the README linksdoc/refactoring_notes/planned/policy_set_audit_2026-10-21.md, which does not exist yet; README rows for my five policies are correct.CLAUDE.md"Structure" lists five production executables;production/CMakeLists.txt:11,24builds a sixth,simple_persistent_worker. - Rules only in policies, not in CLAUDE.md or any skill: how to write a test (independent expected values, named tolerances, negative controls, fixed seeds), the floor rule and
seed_offset, the persistent-worker and coarray invariants (no skill exists),UI_ENVIRONMENT_KEYS/accepts. CLAUDE.md "Routing" does not point to the test, UI, coarray or persistent-worker policies (the skillssimple-architectureandsimple-main-uido for the first two). - Rules only in skills/CLAUDE.md, not in any policy: private-program required keys (ui U3),
TRACED_DEFAULT_HELPERSobligation (ui U2), "a new exec router goes into the*_exec_apimodule of its executable" (simple-main-apis), thin-commander flow (now in the layering draft), release-4 no-alias rule (only partly in ui policy), "keep master work in strategies, not commanders" (CLAUDE.md).
Unverified¶
- All timings and measurements: compile-time Evidence table, "test code is a fifth of summed compile time", "gate takes about 5 s", card "Cost" lines, profile medians/spreads/worst runs (only 8 constants spot-checked against test sources).
- Whether the commit-hash
.modchange really forces a full rebuild after each commit (mechanism verified in the.mod, cascade not built). - Test policy 6.4 (external
SIMPLE_data_testingworkflow: 50-micrograph subsets, FSC criteria): lives in another repository. - Dispatcher internals beyond constants (SIGTERM/SIGKILL ordering,
/procsampling, process-group kill timing, WNOWAIT) andtest=profilescaling rules (reservation/deadline scaling). - Coarray runtime behaviour (no OpenCoarrays here); persistent-worker mutex discipline and thread-slot lifecycle read but not traced line by line.
validate_complete_ui_json.pyrule details beyond the forbidden placeholders; the stream-contract review flow was not run.audit_ui_defaultsoutput depends onbuild/bin/simple_private_execbuilt 10:12 today from the tree above.- The per-file blame dates used for "new since 2026-10-04" counts (
git blame -w) can be moved by whitespace-only or rename commits.