{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D5","name":"Coupling","shortDescription":{"text":"Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D5"},{"id":"D6","name":"Cohesion (LCOM4)","shortDescription":{"text":"Cohesion (LCOM4)"},"helpUri":"https://codehealth.canine.dev/dimensions/D6"},{"id":"D8","name":"Code Coverage","shortDescription":{"text":"Code Coverage"},"helpUri":"https://codehealth.canine.dev/dimensions/D8"},{"id":"D12","name":"Dependency Hygiene","shortDescription":{"text":"Dependency Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/D12"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"id":"D14","name":"License Compliance","shortDescription":{"text":"License Compliance"},"helpUri":"https://codehealth.canine.dev/dimensions/D14"},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D17","name":"Explicit Debt","shortDescription":{"text":"Explicit Debt"},"helpUri":"https://codehealth.canine.dev/dimensions/D17"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A07:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"],"owasp":"A07:2025"}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A05:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"],"owasp":"A05:2025"}},{"id":"D30","name":"Dependency Vulnerabilities","shortDescription":{"text":"Dependency Vulnerabilities"},"helpUri":"https://codehealth.canine.dev/dimensions/D30","relationships":[{"target":{"id":"CWE-1395","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-937","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A03:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1395","CWE-937"],"owasp":"A03:2025"}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D43","name":"Malicious Dependencies","shortDescription":{"text":"Malicious Dependencies"},"helpUri":"https://codehealth.canine.dev/dimensions/D43","relationships":[{"target":{"id":"CWE-506","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"A08:2025","toolComponent":{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-506"],"owasp":"A08:2025"}},{"id":"D44","name":"Platform End-of-Life","shortDescription":{"text":"Platform End-of-Life"},"helpUri":"https://codehealth.canine.dev/dimensions/D44"},{"id":"AX10","name":"Code composition","shortDescription":{"text":"Code composition"},"helpUri":"https://codehealth.canine.dev/dimensions/AX10"},{"id":"AX3","name":"Project dependency cycles","shortDescription":{"text":"Project dependency cycles"},"helpUri":"https://codehealth.canine.dev/dimensions/AX3"},{"id":"AX4","name":"Dependency direction","shortDescription":{"text":"Dependency direction"},"helpUri":"https://codehealth.canine.dev/dimensions/AX4"},{"id":"AXB2","name":"Runtime readiness","shortDescription":{"text":"Runtime readiness"},"helpUri":"https://codehealth.canine.dev/dimensions/AXB2"},{"id":"ED5","name":"Idempotency","shortDescription":{"text":"Idempotency"},"helpUri":"https://codehealth.canine.dev/dimensions/ED5"},{"id":"M1","name":"Documentation (README)","shortDescription":{"text":"Documentation (README)"},"helpUri":"https://codehealth.canine.dev/dimensions/M1"},{"id":"M2","name":"Architecture documentation","shortDescription":{"text":"Architecture documentation"},"helpUri":"https://codehealth.canine.dev/dimensions/M2"},{"id":"M3","name":"Folder \u0026 project structure","shortDescription":{"text":"Folder \u0026 project structure"},"helpUri":"https://codehealth.canine.dev/dimensions/M3"},{"id":"M4","name":"Documentation accuracy","shortDescription":{"text":"Documentation accuracy"},"helpUri":"https://codehealth.canine.dev/dimensions/M4"},{"id":"P1","name":"CI/CD gates","shortDescription":{"text":"CI/CD gates"},"helpUri":"https://codehealth.canine.dev/dimensions/P1"},{"id":"P2","name":"Observability","shortDescription":{"text":"Observability"},"helpUri":"https://codehealth.canine.dev/dimensions/P2"},{"id":"P3","name":"Security \u0026 performance tooling","shortDescription":{"text":"Security \u0026 performance tooling"},"helpUri":"https://codehealth.canine.dev/dimensions/P3"},{"id":"PF3","name":"Async \u0026 latency hygiene","shortDescription":{"text":"Async \u0026 latency hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/PF3"},{"id":"X10","name":"Duplicated predicate","shortDescription":{"text":"Duplicated predicate"},"helpUri":"https://codehealth.canine.dev/dimensions/X10"},{"id":"X12","name":"Unreachable branch","shortDescription":{"text":"Unreachable branch"},"helpUri":"https://codehealth.canine.dev/dimensions/X12"},{"id":"X13","name":"Undrained process stream","shortDescription":{"text":"Undrained process stream"},"helpUri":"https://codehealth.canine.dev/dimensions/X13"},{"id":"X14","name":"Bypassable address classification","shortDescription":{"text":"Bypassable address classification"},"helpUri":"https://codehealth.canine.dev/dimensions/X14"},{"id":"X15","name":"Unvalidated length from an untrusted reader","shortDescription":{"text":"Unvalidated length from an untrusted reader"},"helpUri":"https://codehealth.canine.dev/dimensions/X15"},{"id":"X17","name":"Uncapped recursion over a caller-supplied document","shortDescription":{"text":"Uncapped recursion over a caller-supplied document"},"helpUri":"https://codehealth.canine.dev/dimensions/X17"},{"id":"X19","name":"Unrestored process-global state","shortDescription":{"text":"Unrestored process-global state"},"helpUri":"https://codehealth.canine.dev/dimensions/X19"},{"id":"X20","name":"Mistyped argument guard","shortDescription":{"text":"Mistyped argument guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X20"},{"id":"X21","name":"Side-effecting pattern guard","shortDescription":{"text":"Side-effecting pattern guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X21"},{"id":"X22","name":"Contradicted release guard","shortDescription":{"text":"Contradicted release guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X22"},{"id":"X23","name":"Unguarded diagnostic materialisation","shortDescription":{"text":"Unguarded diagnostic materialisation"},"helpUri":"https://codehealth.canine.dev/dimensions/X23"},{"id":"X24","name":"Document value interpolated into markup unescaped","shortDescription":{"text":"Document value interpolated into markup unescaped"},"helpUri":"https://codehealth.canine.dev/dimensions/X24"},{"id":"X25","name":"Inert configuration knob","shortDescription":{"text":"Inert configuration knob"},"helpUri":"https://codehealth.canine.dev/dimensions/X25"},{"id":"X26","name":"Unsynchronised callback handoff","shortDescription":{"text":"Unsynchronised callback handoff"},"helpUri":"https://codehealth.canine.dev/dimensions/X26"},{"id":"X27","name":"Collection changed while being enumerated","shortDescription":{"text":"Collection changed while being enumerated"},"helpUri":"https://codehealth.canine.dev/dimensions/X27"},{"id":"X28","name":"Index access outside its own emptiness guard","shortDescription":{"text":"Index access outside its own emptiness guard"},"helpUri":"https://codehealth.canine.dev/dimensions/X28"},{"id":"X3","name":"Exception handling","shortDescription":{"text":"Exception handling"},"helpUri":"https://codehealth.canine.dev/dimensions/X3"},{"id":"X30","name":"Support guard that admits what it rejects","shortDescription":{"text":"Support guard that admits what it rejects"},"helpUri":"https://codehealth.canine.dev/dimensions/X30"},{"id":"X32","name":"Type resolved by simple name across every loaded assembly","shortDescription":{"text":"Type resolved by simple name across every loaded assembly"},"helpUri":"https://codehealth.canine.dev/dimensions/X32"},{"id":"X6","name":"Hand-rolled structured-format parsing","shortDescription":{"text":"Hand-rolled structured-format parsing"},"helpUri":"https://codehealth.canine.dev/dimensions/X6"},{"id":"X7","name":"Silent fallback defaults","shortDescription":{"text":"Silent fallback defaults"},"helpUri":"https://codehealth.canine.dev/dimensions/X7"},{"id":"X9","name":"Subsumed condition operand","shortDescription":{"text":"Subsumed condition operand"},"helpUri":"https://codehealth.canine.dev/dimensions/X9"}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"train_ppo.ppo_train_epoch (cyclomatic 29): train_ppo.ppo_train_epoch has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_ppo.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"e40c5fe68152d84aad8ec41dc77834070b044d9dc3d418cced7cf046d356f28e"}},{"ruleId":"D1","level":"warning","message":{"text":"train_agent.calculate_rewards (cyclomatic 26): train_agent.calculate_rewards has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"3e5f4d17b13b2a729183d78cb741b26cfac42a597d3884d2414b1a5a265e2e58"}},{"ruleId":"D1","level":"warning","message":{"text":"train_agent.rl_train_epoch (cyclomatic 26): train_agent.rl_train_epoch has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"c629bc039974de510f2f1eeef1e35e47653c919c4ddb98521328fa713e523cb1"}},{"ruleId":"D1","level":"warning","message":{"text":"train_grpo.grpo_train_epoch (cyclomatic 23): train_grpo.grpo_train_epoch has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"165f1f76c347f5bd88b956ab74e8b87370fa4e74748a3b843645837a64ada461"}},{"ruleId":"D1","level":"warning","message":{"text":"train_distillation.train_epoch (cyclomatic 19): train_distillation.train_epoch has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"cdddbc45f708da9b4074ab0cda9efdcc805f9feacccd1d527d7fc92952a6a475"}},{"ruleId":"D1","level":"warning","message":{"text":"MiniMindForCausalLM.generate (cyclomatic 18): MiniMindForCausalLM.generate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"model/model_minimind.py"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"c6689021529ef02773f546444782cfbfd8ec561caf6b0743d6bafcbc8cc080ca"}},{"ruleId":"D2","level":"warning","message":{"text":"train_ppo.ppo_train_epoch (cognitive 73): train_ppo.ppo_train_epoch has cognitive complexity 73 (threshold 15). Drivers by points: if/else 14 (42 pts), ternaries 5 (15 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_ppo.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"80fb6c1ee2164b0dd8a76758b56da737290c4a6a849a70c287e3778e59c1ee19"}},{"ruleId":"D2","level":"warning","message":{"text":"train_agent.calculate_rewards (cognitive 71): train_agent.calculate_rewards has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 13 (36 pts), if/else 8 (23 pts), loops 3 (6 pts), error handling 1 (5 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"8b8ca12a559f6eb1bc83feff3be39303a973d11d9b76896a542b64431d52e17a"}},{"ruleId":"D2","level":"warning","message":{"text":"train_agent.rl_train_epoch (cognitive 52): train_agent.rl_train_epoch has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 4 (10 pts), ternaries 4 (10 pts), boolean chains 7 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"9f98d87faeb62af41ef0e41b00ae300c7269a9cff6709883fb2586cf6aac48cd"}},{"ruleId":"D2","level":"warning","message":{"text":"train_grpo.grpo_train_epoch (cognitive 44): train_grpo.grpo_train_epoch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (8 pts), ternaries 3 (8 pts), boolean chains 7 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"346a396dfab56785f7610beff177558d1a214b30a9f71b337b358d9bcb20586b"}},{"ruleId":"D2","level":"warning","message":{"text":"trainer_utils.lm_checkpoint (cognitive 40): trainer_utils.lm_checkpoint has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 6 (17 pts), loops 1 (2 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/trainer_utils.py"},"region":{"startLine":65}}}],"partialFingerprints":{"codehealthFindingId/v1":"c4636c5381593321fd69e789be4cf76432f558abaa8739fccf3714d79f6f3b1f"}},{"ruleId":"D2","level":"warning","message":{"text":"train_distillation.train_epoch (cognitive 38): train_distillation.train_epoch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 4 (13 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"577c9363ce75fe6847e485e372197185ec0cab1647868b75459dd28b319d9b58"}},{"ruleId":"D2","level":"warning","message":{"text":"MiniMindForCausalLM.generate (cognitive 31): MiniMindForCausalLM.generate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 5 (9 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"model/model_minimind.py"},"region":{"startLine":262}}}],"partialFingerprints":{"codehealthFindingId/v1":"be0a57a10e4732ffe408fa4c393cedaa5f376db18bc208710a0ae00298577d25"}},{"ruleId":"D2","level":"warning","message":{"text":"train_agent.rollout_single (cognitive 29): train_agent.rollout_single has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 1 (4 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"30b367d3cb776924bf8e702217369f72421e31611fc389f5a03ea15aefd3b913"}},{"ruleId":"D2","level":"warning","message":{"text":"train_full_sft.train_epoch (cognitive 25): train_full_sft.train_epoch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_full_sft.py"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"3578d45c7cdf7e3411fb444a52a3d474ef1dd50b9593c7ec55b1c77e2caa19cb"}},{"ruleId":"D2","level":"warning","message":{"text":"train_pretrain.train_epoch (cognitive 25): train_pretrain.train_epoch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_pretrain.py"},"region":{"startLine":24}}}],"partialFingerprints":{"codehealthFindingId/v1":"9e3bb54f0590c1b6f5d595078b6df84b93e6aba2d81d410f02a00cc3a592e454"}},{"ruleId":"D2","level":"warning","message":{"text":"train_dpo.train_epoch (cognitive 22): train_dpo.train_epoch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_dpo.py"},"region":{"startLine":53}}}],"partialFingerprints":{"codehealthFindingId/v1":"90711a5e08a836bc6f55a8b0730541db392d4b5b09abd88121c6ded5cf87a3e8"}},{"ruleId":"D2","level":"warning","message":{"text":"train_lora.train_epoch (cognitive 22): train_lora.train_epoch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_lora.py"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"32c4f80dbd4b2993af210f5fef87c0f9df64b28bdf46a1f4456ae530ce0e2d90"}},{"ruleId":"D2","level":"warning","message":{"text":"train_tokenizer.get_texts (cognitive 18): train_tokenizer.get_texts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_tokenizer.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"d59524d154aa9ea1d0cd9e841a200f6f38c2a867ebcd49090c31e739172a65ba"}},{"ruleId":"D2","level":"warning","message":{"text":"SFTDataset.generate_labels (cognitive 17): SFTDataset.generate_labels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (DPODataset.generate_loss_mask) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dataset/lm_dataset.py"},"region":{"startLine":91}}}],"partialFingerprints":{"codehealthFindingId/v1":"661e222add6795ac47c7cf7d42639bfe45fd0bf1d28a0468ccc80d5d70ad6e29"}},{"ruleId":"D2","level":"warning","message":{"text":"DPODataset.generate_loss_mask (cognitive 17): DPODataset.generate_loss_mask has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SFTDataset.generate_labels) has the same decision points, in the same order, at the same nesting depths \u2014 so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dataset/lm_dataset.py"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"63ced057464044c0c24ded1ef6cebf943a6914b597a779a30f35f17b541069bd"}},{"ruleId":"D2","level":"warning","message":{"text":"train_grpo.calculate_rewards (cognitive 17): train_grpo.calculate_rewards has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (11 pts), if/else 1 (3 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"a294d53a21885afba7527e742f6a55d91206d34cf1d18f341cdb60dc2a05562c"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (3 members, 32 shared lines): trainer/train_full_sft.py:25-72 | trainer/train_lora.py:26-67 | trainer/train_pretrain.py:25-71 \u2014 These 3 members are variants of one another: a block of 32 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_full_sft.py"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"afe824b84079a2ec5ade45ffeac5bb84c4233150e32ba19e55c8e85af8f3c7c4"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (29 shared lines): trainer/train_agent.py:246-367 | trainer/train_grpo.py:72-196 \u2014 These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"da385d7c8d6de549c4f54d924af6cbe23d1ffbc4fd74e3a68b46e213ecdd595f"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (22 shared lines): trainer/train_distillation.py:40-134 | trainer/train_dpo.py:54-119 \u2014 These two members are variants of one another: 22 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"f167efe42248862a5d4a59b191cec27ba57f2533cd19e0b26b09a581d96d695a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (24 corresponding lines): trainer/train_grpo.py:38-68 | trainer/train_ppo.py:52-75 \u2014 These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":38}}}],"partialFingerprints":{"codehealthFindingId/v1":"82d5bc0931360c44b4e895333a8db1fe22a26881f8251fc96af5c8fadc5e8016"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (18 corresponding lines): eval_llm.py:14-31 | scripts/serve_openai_api.py:29-47 \u2014 These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eval_llm.py"},"region":{"startLine":14}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8961cdf7242bc7dee46f7deefcb44024bd33fc346389e5381932a32345d983e"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (16 corresponding lines): dataset/lm_dataset.py:92-107 | dataset/lm_dataset.py:181-196 \u2014 These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dataset/lm_dataset.py"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"7220401735ce9371b11952c2b1ba6b6f6eed40fd4f83b31712124d0a078eee19"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copies of one member (3 members, 3\u002B corresponding lines): trainer/train_agent.py:34-36 | trainer/train_grpo.py:32-34 | trainer/train_ppo.py:30-32 \u2014 These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"aaee3fa7550c92770ce904a6ffa18881e84c18cdcf99455b6d051b10ccd2fb9b"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (7 corresponding lines): dataset/lm_dataset.py:127-133 | dataset/lm_dataset.py:201-207 \u2014 These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dataset/lm_dataset.py"},"region":{"startLine":127}}}],"partialFingerprints":{"codehealthFindingId/v1":"47e5ede6852d38f86663451228165ba192125ba200c988c70c0b0bbdc140148b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 3): trainer/train_full_sft.py:25-41 | trainer/train_lora.py:26-42 | trainer/train_pretrain.py:25-41 \u2014 before extracting anything, compare \u0060trainer/train_full_sft.py\u0060 and \u0060trainer/train_lora.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_full_sft.py"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2b90aef8a5e00e3cb714311f0a06d0e01778cfbaf2b7fccf05fe37e7e913d8f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12\u201314 lines \u00D7 4): trainer/train_distillation.py:93-104 | trainer/train_dpo.py:85-96 | trainer/train_full_sft.py:38-51 | trainer/train_pretrain.py:38-51 \u2014 before extracting anything, compare \u0060trainer/train_distillation.py\u0060 and \u0060trainer/train_dpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"8cfbd832c70c43e6cc08abb930f9b35b9136b5942c444a28ccbf91a35b7a03c0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (2\u201311 lines \u00D7 5): trainer/train_distillation.py:107-108 | trainer/train_dpo.py:99-100 | trainer/train_full_sft.py:44-54 | trainer/train_lora.py:44-53 | trainer/train_pretrain.py:44-54 \u2014 before extracting anything, compare \u0060trainer/train_distillation.py\u0060 and \u0060trainer/train_dpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":107}}}],"partialFingerprints":{"codehealthFindingId/v1":"59ded1860077d8cb1557802a9bf82fe744ba3922d3f63d8640bf0dfb8352037c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19 lines \u00D7 2): trainer/train_grpo.py:50-68 | trainer/train_ppo.py:57-75 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":50}}}],"partialFingerprints":{"codehealthFindingId/v1":"116ec3a0e02466157d574ada3feca8eb70346f4bfeb19cbe255f30e6ee34271e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): dataset/lm_dataset.py:93-102 | dataset/lm_dataset.py:182-191 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dataset/lm_dataset.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"b2d794f992cc677ec43a694f4b6b1d015a5442be2a2652fe1a61497f372c30a0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): trainer/train_ppo.py:237-244 | trainer/train_ppo.py:247-254 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_ppo.py"},"region":{"startLine":237}}}],"partialFingerprints":{"codehealthFindingId/v1":"260df22d3b77a64bef2f3e382a4643bb5016e00a7287cdab618dfd58a177ea0f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 5): trainer/train_distillation.py:98-104 | trainer/train_dpo.py:90-96 | trainer/train_full_sft.py:44-51 | trainer/train_lora.py:44-50 | trainer/train_pretrain.py:44-51 \u2014 before extracting anything, compare \u0060trainer/train_distillation.py\u0060 and \u0060trainer/train_dpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":98}}}],"partialFingerprints":{"codehealthFindingId/v1":"481cdf76eec2aa0f8affb643233e0eede132165af5eefa1979c447bfd41b0582"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): trainer/train_agent.py:319-329 | trainer/train_grpo.py:132-142 \u2014 before extracting anything, compare \u0060trainer/train_agent.py\u0060 and \u0060trainer/train_grpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"9acac883e1734a79477e2ad4e707562142e002d562aebe762c8db9ce5a2d0c23"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5\u20137 lines \u00D7 2): trainer/train_agent.py:360-366 | trainer/train_grpo.py:189-193 \u2014 before extracting anything, compare \u0060trainer/train_agent.py\u0060 and \u0060trainer/train_grpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060trainer/train_agent.py:360\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":360}}}],"partialFingerprints":{"codehealthFindingId/v1":"0fa0816d4989d9b8526eb7d5cb076d2f1517fd05e38773662c4d295fe148bd42"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): dataset/lm_dataset.py:75-80 | dataset/lm_dataset.py:244-249 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"dataset/lm_dataset.py"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f97bd4d22bceeedfc5bc03ccb35dc59b7ec0e6449ac65b453ee27f83a4b4137"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): trainer/train_agent.py:131-136 | trainer/train_agent.py:225-230 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"c82196844f313bd85fdd345b64f7d42294e39b0a3e108f9a51d9c51aa82b0068"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): trainer/train_agent.py:312-317 | trainer/train_grpo.py:119-124 \u2014 before extracting anything, compare \u0060trainer/train_agent.py\u0060 and \u0060trainer/train_grpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":312}}}],"partialFingerprints":{"codehealthFindingId/v1":"65d12073c114a8776874b85a64bd5ce8e5835d36348b6f38ca081bd84dd08f3f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): trainer/train_agent.py:332-336 | trainer/train_grpo.py:144-150 \u2014 before extracting anything, compare \u0060trainer/train_agent.py\u0060 and \u0060trainer/train_grpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":332}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2d81481ebe7f461bde86d343d8fce35f51d286c82f38b84ad500956872b2d67"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): trainer/train_grpo.py:106-112 | trainer/train_ppo.py:102-108 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":106}}}],"partialFingerprints":{"codehealthFindingId/v1":"727427a030581e3d5721bc1ff5508c66bf73b8884ad0c51377bd95314609aa0f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): scripts/web_demo.py:307-313 | trainer/trainer_utils.py:57-63 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"scripts/web_demo.py"},"region":{"startLine":307}}}],"partialFingerprints":{"codehealthFindingId/v1":"11d286a636971a17b53df4fea52ce4de9a319254b74199a3a03362db309d98d3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): eval_llm.py:25-29 | scripts/serve_openai_api.py:41-45 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eval_llm.py"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"594d3a6896575dbcb9d7954c7e0bdc27c34a64e2a676b09cc992439307fe27ad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): trainer/train_distillation.py:122-129 | trainer/train_dpo.py:106-113 \u2014 before extracting anything, compare \u0060trainer/train_distillation.py\u0060 and \u0060trainer/train_dpo.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_distillation.py"},"region":{"startLine":122}}}],"partialFingerprints":{"codehealthFindingId/v1":"555eeecc0805b22ae28ec3b4a12fbddb3c4d870d80dc38cea3a8e631e12bb6a1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): trainer/train_full_sft.py:57-61 | trainer/train_lora.py:56-60 | trainer/train_pretrain.py:57-61 \u2014 before extracting anything, compare \u0060trainer/train_full_sft.py\u0060 and \u0060trainer/train_lora.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_full_sft.py"},"region":{"startLine":57}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dc21e47b71ea4925f081a35d0f8997489e94c497ec2f994ea1061ace39cc326"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): scripts/web_demo.py:178-183 | scripts/web_demo.py:192-197 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"scripts/web_demo.py"},"region":{"startLine":178}}}],"partialFingerprints":{"codehealthFindingId/v1":"b5a5fe352db4989ae474a5cccde69bff24e4be8024bfc2261a0ecaec6cc0efce"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): scripts/convert_model.py:27-31 | scripts/convert_model.py:86-91 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060scripts/convert_model.py:26\u0060 calls \u0060save_pretrained\u0060 and \u0060scripts/convert_model.py:85\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"scripts/convert_model.py"},"region":{"startLine":27}}}],"partialFingerprints":{"codehealthFindingId/v1":"cfcf69e24d1eba6516a31a0e8b422c86d448c1c8be8a29957550211b39eaab9f"}},{"ruleId":"D5","level":"warning","message":{"text":"Off the main sequence: dataset: dataset: abstractness 0.00, instability 0.00, distance 1.00 \u2014 zone of pain \u2014 concrete and depended on by 1 project(s), so it\u0027s rigid to change."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6676e83be65d4e6f197bae861123419510690a42961e7d4156a7ce8595743418"}},{"ruleId":"D5","level":"warning","message":{"text":"Off the main sequence: model: model: abstractness 0.00, instability 0.00, distance 1.00 \u2014 zone of pain \u2014 concrete and depended on by 3 project(s), so it\u0027s rigid to change."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"80201114587ef9e5e0d2c3fa706df4a7be0bf849dcf3d703549724d762c42766"}},{"ruleId":"D8","level":"error","message":{"text":"No automated tests: No automated tests \u2014 no test code was found in this repository. Untested code is the largest single risk to changing it safely. Start with the code you change most often: add a suite in a framework a runner can collect (pytest or unittest), and run it in CI so the gap cannot reopen."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"3132564c6310e5d01a231f252a02d5d2f5a542c0a8fa29a14c89693f1e3df871"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: trainer/train_agent.py: trainer/train_agent.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in train_agent.rl_train_epoch at line 245. 5 of those changes were fix/bug commits, and the other 5 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-29 14:57:05 \u002B08:00\u0027 --until=\u00272026-10-27 14:57:05 \u002B08:00\u0027 --full-history --no-merges -- trainer/train_agent.py\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":245}}}],"partialFingerprints":{"codehealthFindingId/v1":"a4dad78295f2b13042a1b43a698005c3993a3cf95bc3a0328a319e807d15a0b3"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: trainer/train_ppo.py: trainer/train_ppo.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in train_ppo.ppo_train_epoch at line 78. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-29 14:57:05 \u002B08:00\u0027 --until=\u00272026-10-27 14:57:05 \u002B08:00\u0027 --full-history --no-merges -- trainer/train_ppo.py\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_ppo.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"545fbcb1f1ad9d357dbf2956411d1d9b4939a5f10e2b76a135a6a6571c7c67cf"}},{"ruleId":"D15","level":"warning","message":{"text":"Hotspot: trainer/train_grpo.py: trainer/train_grpo.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in train_grpo.grpo_train_epoch at line 71. 3 of those changes were fix/bug commits, and the other 4 changed it for other reasons \u2014 this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one \u2014 a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-29 14:57:05 \u002B08:00\u0027 --until=\u00272026-10-27 14:57:05 \u002B08:00\u0027 --full-history --no-merges -- trainer/train_grpo.py\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_grpo.py"},"region":{"startLine":71}}}],"partialFingerprints":{"codehealthFindingId/v1":"1d9244eb0fe50da46aa998aa99d59fa02f7860d6f588720b86279f6a0b6cfe6d"}},{"ruleId":"D15","level":"warning","message":{"text":"Repeated repair: eval_llm.py: eval_llm.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file\u0027s churn. Its max cyclomatic complexity is 8 (its worst body is eval_llm.main at line 33), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn \u00D7 complexity hotspot \u2014 the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: \u201C[fix] decide native-vs-transformers loading by directory name, not substring\u201D; \u201Cfix: align LoRA inference paths with training output\u201D; \u201C[fix] unify Ctrl\u002BC handling\u201D; \u201Cfix: eval_llm.py Ctrl\u002BC \u9000\u51FA\u5F02\u5E38\u4FEE\u590D\u201D. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with \u0060git log --since=\u00272026-07-29 14:57:05 \u002B08:00\u0027 --until=\u00272026-10-27 14:57:05 \u002B08:00\u0027 --full-history --no-merges -- eval_llm.py\u0060: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each \u2014 a difference of several commits on a file whose history was re-landed or reverted inside the window."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"eval_llm.py"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"f6ba6f7d27b4bcfbb779b13791c65258a00955c3428c2fe0f3e58a093d35f490"}},{"ruleId":"D30","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"939e7820f308976365c3f6d3a26d247e0a2fde4c27ad5ab0258b6de69008b79c"},"properties":{"dependency":{"package":"nltk","version":"3.8","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","PYSEC-2024-167","PYSEC-2026-2078","PYSEC-2026-2085","PYSEC-2026-2235","PYSEC-2026-2236","PYSEC-2026-2237","PYSEC-2026-3581","PYSEC-2026-3582","PYSEC-2026-3583","PYSEC-2026-3584","PYSEC-2026-3657","PYSEC-2026-3722","PYSEC-2026-3723","PYSEC-2026-3724","PYSEC-2026-3728","PYSEC-2026-3729","PYSEC-2026-3730","PYSEC-2026-3731","PYSEC-2026-3732","PYSEC-2026-3733","PYSEC-2026-3734","PYSEC-2026-3735","PYSEC-2026-3736","PYSEC-2026-3737","PYSEC-2026-3738","PYSEC-2026-3739","PYSEC-2026-3740","PYSEC-2026-3741","PYSEC-2026-3748","PYSEC-2026-3749","PYSEC-2026-3750","PYSEC-2026-3751","PYSEC-2026-3752","PYSEC-2026-3868","PYSEC-2026-3869","PYSEC-2026-3870","PYSEC-2026-3871","PYSEC-2026-3954","PYSEC-2026-3955","PYSEC-2026-4318","PYSEC-2026-597","PYSEC-2026-96","PYSEC-2026-97","PYSEC-2026-98","PYSEC-2026-99"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9bf0b6dcf26eb72cbe8dd45d0e0d79b37eed2c7ad7e312f48d7329f567150b81"},"properties":{"dependency":{"package":"sentence-transformers","version":"2.3.1","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","PYSEC-2026-4164"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"957a1d60c8c2aeb14cbe5bd4f7929ed7e1f1f0656592db8d7bc16a50a50f9195"},"properties":{"dependency":{"package":"flask-cors","version":"4.0.0","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","PYSEC-2024-271","PYSEC-2024-71","PYSEC-2026-1383","PYSEC-2026-1384","PYSEC-2026-1385"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"adbf44f8b4a6edb926d1a888cc8101a501c27c1d49346708aac7d67704aaf860"},"properties":{"dependency":{"package":"sentencepiece","version":"0.2.0","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","PYSEC-2026-1909"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"60d31a051760159631eaa9ba0e90c965120cf2c230f2b5ca78fdc144cd48fdda"},"properties":{"dependency":{"package":"transformers","version":"4.57.6","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","PYSEC-2025-217","PYSEC-2026-2288","PYSEC-2026-2289","PYSEC-2026-2290","PYSEC-2026-3929","PYSEC-2026-4174"],"reachability":{"kind":"production","file":"eval_llm.py","line":7}}}},{"ruleId":"D30","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5e293b69b9e9da82dd3ba81ef3f88e37ba0bdee0a8c1e99907817f561f377343"},"properties":{"dependency":{"package":"ujson","version":"5.1.0","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","OSV-2021-1809","OSV-2021-955","PYSEC-2022-25","PYSEC-2026-1056","PYSEC-2026-1057","PYSEC-2026-2292","PYSEC-2026-2293","PYSEC-2026-2294"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"08a59b30f762a6f9701a003851d76b230c1c2279d779744b586cf1d523bd6fb6"},"properties":{"dependency":{"package":"datasets","version":"3.6.0","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","PYSEC-2026-3716"],"reachability":{"kind":"production","file":"dataset/lm_dataset.py","line":6}}}},{"ruleId":"D30","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"78834919ac9df11fc4c1e0e581d8dae587ec8e752d479cd9c80e4a3c464c34ff"},"properties":{"dependency":{"package":"flask","version":"3.0.3","advisory":"PYSEC-2026-2151","aliases":["[CVE redacted]","[GHSA redacted]"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9c4166bc67b9bc20b1458c020354ac9d41556126b68754c34a569b30a815717b"},"properties":{"dependency":{"package":"marshmallow","version":"3.22.0","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","PYSEC-2026-1605"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"41c40677ebaf4bd83070e314f921f88ddad2e3d3a5df0e8b159f0136a6ff203a"},"properties":{"dependency":{"package":"jinja2","version":"3.1.2","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[CVE redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","[GHSA redacted]","PYSEC-2026-1471","PYSEC-2026-1472","PYSEC-2026-1473","PYSEC-2026-1474","PYSEC-2026-1475"],"reachability":{"kind":"unknown"}}}},{"ruleId":"D30","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"31fe04f0d006c45853b37c692de14e085a04d91900c8d97d04b103b10d7663cf"},"properties":{"dependency":{"package":"streamlit","version":"1.50.0","advisory":"[GHSA redacted]","aliases":["[CVE redacted]","[CVE redacted]","[GHSA redacted]","PYSEC-2026-212","PYSEC-2026-2285"],"reachability":{"kind":"production","file":"scripts/web_demo.py","line":10}}}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling clique: train_agent.py, train_grpo.py, train_ppo.py: 3 files \u2014 \u0060trainer/train_agent.py\u0060, \u0060trainer/train_grpo.py\u0060, \u0060trainer/train_ppo.py\u0060 \u2014 all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique\u0027s coupling clears at once \u2014 you do not need to break each pair individually."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1ee3141e200c5559ee43190ebb35865e8063388b71d0376988701611e7ba104"}},{"ruleId":"M2","level":"note","message":{"text":"No ADRs: No Architecture Decision Records found \u2014 no conventional ADR directory, no numbered \u0060NNNN-title\u0060 documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"670b3d6e36a756d63097d0dfbf90afd5fc761308800b9354894a07c3f4e4aa14"}},{"ruleId":"M3","level":"note","message":{"text":"No src/ separation: Most of the production code is in directories of its own, but 1 application file(s) sit at the repository root beside the build and tooling files (\u0060eval_llm.py\u0060)."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"fdf7f5b24e313364d10170a5c2542959902fe0d26ed70edef3eaa10ec5bcdb1d"}},{"ruleId":"P1","level":"warning","message":{"text":"No CI pipeline: No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, \u2026) \u2014 changes aren\u0027t gated by an automated build/test."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"44f01af96e50474fba2df84d95ddf4f7e1d34c29c307830b9efc9057daa6b670"}},{"ruleId":"P2","level":"warning","message":{"text":"No structured logging: No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page \u2014 but when a run fails on a user\u0027s machine, neither they nor you have anything to read."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"9f10d71351c6778ebe84e761f82a90d4f9ed6c64f5e01975ede8fda7e4e2ebc5"}},{"ruleId":"P3","level":"note","message":{"text":"No SAST: No static application security testing detected. For this repository\u0027s stack, add bandit, \u0060semgrep --config=p/python\u0060, or CodeQL\u0027s python pack \u2014 this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge\u0027s web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen \u2014 if that is your case the row is wrong, and saying so is more useful than adding a second scanner."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060args.debug_mode and is_main_process() and step % args.debug_interval == 0\u0060 appears character-identically in 3 files \u2014 trainer/train_agent.py, trainer/train_grpo.py, trainer/train_ppo.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":295}}}],"partialFingerprints":{"codehealthFindingId/v1":"1ee574c427a59c407fb1662aa3d0bec1cf8af62eccc4f77d39bf192ebfc76806"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060not dist.is_initialized() or dist.get_rank() == 0\u0060 appears character-identically in 2 files \u2014 trainer/rollout_engine.py, trainer/trainer_utils.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/rollout_engine.py"},"region":{"startLine":177}}}],"partialFingerprints":{"codehealthFindingId/v1":"288a2f75229cccb7915ccf3074f0c29ca87d21eecfc36475aba8dead9e1595e3"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060step % args.accumulation_steps == 0 or step == iters\u0060 appears character-identically in 7 files \u2014 trainer/train_agent.py, trainer/train_distillation.py, trainer/train_dpo.py, trainer/train_full_sft.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":335}}}],"partialFingerprints":{"codehealthFindingId/v1":"b47fea841d3b8d203397d0b2638cb01638e895034bd6b5e11b4c2d2467271271"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060step % args.log_interval == 0 or step == iters\u0060 appears character-identically in 7 files \u2014 trainer/train_agent.py, trainer/train_distillation.py, trainer/train_dpo.py, trainer/train_full_sft.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":339}}}],"partialFingerprints":{"codehealthFindingId/v1":"2148ebc37586db8b5453e42ee4ae8fe57aa7450fc4c730a47288d88ab84d801d"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060step % args.save_interval == 0 or step == iters\u0060 appears character-identically in 8 files \u2014 trainer/train_agent.py, trainer/train_distillation.py, trainer/train_dpo.py, trainer/train_full_sft.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":351}}}],"partialFingerprints":{"codehealthFindingId/v1":"f73310da138510d150a1b2bd2d92987ce5d8abb962ad2789d5d7adad3cac813b"}},{"ruleId":"X10","level":"note","message":{"text":"Duplicated predicate: \u0060train_sampler and train_sampler.set_epoch(epoch)\u0060 appears character-identically in 8 files \u2014 trainer/train_agent.py, trainer/train_distillation.py, trainer/train_dpo.py, trainer/train_full_sft.py. It is one line, so the duplication detector\u0027s token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":475}}}],"partialFingerprints":{"codehealthFindingId/v1":"e16b37b266fac97500e70c49ffd3abf1f668bf7c74af250b5eeed929f5bec14a"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060except\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/rollout_engine.py"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"1e931f6d813a142088718ad6828c63e06ed116f87dffafe879ff2f9a2a662643"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060except\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":80}}}],"partialFingerprints":{"codehealthFindingId/v1":"43358925cacf02af178c7fc62cd35f08a3071d4401a3db005c8e70b2d6cad7ce"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060except Exception\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":89}}}],"partialFingerprints":{"codehealthFindingId/v1":"e78436250699b05e148bdf5b2e7bfdc5fcd8c2f5a3eccb2ae783d0cca0032cb2"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060except\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"b248f9e4a35c4fa491b162cde32d3b492ceddb5921c804b6710a4e5fd21d8fd3"}},{"ruleId":"X3","level":"warning","message":{"text":"Swallowed exception (caught, then discarded): \u0060except\u0060 takes every exception and records none of it \u2014 the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"trainer/train_agent.py"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"cd5caccca3755c80ec9bd9353488470276306751280e836c2b9a596832706240"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1395","guid":"800e09e7-c11a-8654-9fa6-86f398995fed","name":"Dependency on Vulnerable Third-Party Component","shortDescription":{"text":"Dependency on Vulnerable Third-Party Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1395.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-506","guid":"401d6455-56e3-0552-9a39-f77461673e3f","name":"Embedded Malicious Code","shortDescription":{"text":"Embedded Malicious Code"},"helpUri":"https://cwe.mitre.org/data/definitions/506.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in a Command (\u0027Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an OS Command (\u0027OS Command Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)","shortDescription":{"text":"Improper Neutralization of Input During Web Page Generation (\u0027Cross-site Scripting\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)","shortDescription":{"text":"Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-937","guid":"16f316ae-415c-b354-a59b-1f7905f756e9","name":"Using Components with Known Vulnerabilities","shortDescription":{"text":"Using Components with Known Vulnerabilities"},"helpUri":"https://cwe.mitre.org/data/definitions/937.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Improper Control of Generation of Code (\u0027Code Injection\u0027)","shortDescription":{"text":"Improper Control of Generation of Code (\u0027Code Injection\u0027)"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]},{"name":"OWASP Top 10","guid":"7d1f0c2e-4b6a-4e39-9a51-0b2e8c3d5f61","version":"2025","organization":"OWASP Foundation","informationUri":"https://top10.owasp.org/2025/","isComprehensive":false,"shortDescription":{"text":"The OWASP Top 10:2025 web application security risks."},"taxa":[{"id":"A03:2025","guid":"168e227c-7735-2e57-bc6e-997affe644c5","name":"Software Supply Chain Failures","shortDescription":{"text":"Software Supply Chain Failures"},"helpUri":"https://top10.owasp.org/2025/A03_2025-Software_Supply_Chain_Failures/"},{"id":"A05:2025","guid":"87e86033-3231-8458-8e4a-5cb82743553a","name":"Injection","shortDescription":{"text":"Injection"},"helpUri":"https://top10.owasp.org/2025/A05_2025-Injection/"},{"id":"A07:2025","guid":"334ddd78-539d-d35c-83dd-253647eb7eaf","name":"Authentication Failures","shortDescription":{"text":"Authentication Failures"},"helpUri":"https://top10.owasp.org/2025/A07_2025-Authentication_Failures/"},{"id":"A08:2025","guid":"84b0c297-710e-9a5f-9335-936ecb260c36","name":"Software or Data Integrity Failures","shortDescription":{"text":"Software or Data Integrity Failures"},"helpUri":"https://top10.owasp.org/2025/A08_2025-Software_or_Data_Integrity_Failures/"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":11,"secretScannerRunsExcluded":0}},"redactionTokens":["A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."]}]}