From 3aee813ccd6ef43f95051b7f73afc88737edfd97 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 26 Aug 2026 14:15:22 +0000 Subject: [PATCH] =?UTF-8?q?=C2=A739.8:=20homemaker-py-2v1=20connectivity?= =?UTF-8?q?=20weighting=20=E2=80=94=20MEASURED=20NULL,=20premise=20retract?= =?UTF-8?q?ed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit §38.2 concluded the objective is net-positive on severing a level's circulation: merging a corridor into a habitable sibling gains x6 (value_inside/value_circulation), while "level N not connected" costs x0.5, so break-even needs 0.5^w < 50/300, w > 2.58 -- "severing must cost at least 3 fails and costs 1". The arithmetic is right. The premise is wrong. Shipped anyway, EXPERIMENTAL and default off (byte-identical): fitness.connectivity_weight_for(value_inside, value_circulation) returns the smallest weight making severing net-negative -- 3.0 at the defaults, DERIVED from the rates rather than hard-coded so it tracks them if either is retuned. conf["connectivity_weight"] takes 1.0 / "auto" / a number and counts each connectivity failure as w failures in the 0.5^n penalty. MEASUREMENT: at auto (=3) the §38.2 deletion test does not move at all -- 5/25 rewarded either way, median x0.26 vs x0.27. Reason: the connectivity fail count is UNCHANGED in every rewarded deletion (115->107 fails but 5->5 connectivity; 107->99 but 3->3; 78->71 but 3->3). Weighting a fail that never fires changes nothing. And when a deletion DOES break connectivity, it is already punished. Every such case, 4 seeds per programme: harbor-house 2 of 32 sampled deletions, both punished (x0.00, x0.01); maple-court 5 of 32, all punished (x0.58 .. x0.07). Severing costs 1-2 connectivity fails PLUS the cascade after them, which already outweighs the x6 gain. The flat rule was never the problem. Where §38.2 went wrong: the x4.06 "well-daylit circulation leaf" that motivated the bead was a deletion that did NOT change the connectivity fail count. It was rewarded for removing the leaf's own quality failures -- §38.1's zero-value finding -- and I misread it as a pricing mechanism. §38.2 now carries the retraction inline. Two lessons recorded: a plausible closed-form arithmetic is not a measurement, and when a fix produces exactly no effect, suspect the premise before the implementation. Still standing from §38: §38.1 (buried leaves score zero quality and contribute no value) and §38.3 (frontage budget) are direct measurements. §39.7 remains the better lever on the same symptom -- it made the connectivity fails FIRE, where this would only have made them cost more. Re-opened as homemaker-py-yql: why level-not-connected persists in the best layout when severing is already punished. Evidence now points at reachability, not incentive, and it is newly measurable because §39.7 stopped store cupboards standing in for corridors. 353 passed (+3 new), same 7 pre-existing fixture failures, lint unchanged. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01MJ84Feep79Hhm3E4zZJmnB --- .beads/issues.jsonl | 3 +- DESIGN.md | 80 +++++++++++++++++++++++++++++++-- src/homemaker_layout/fitness.py | 65 ++++++++++++++++++++++++++- tests/test_fitness.py | 26 +++++++++++ 4 files changed, 167 insertions(+), 7 deletions(-) diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 960bec5..4a673f7 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -1,5 +1,6 @@ {"_type":"issue","id":"homemaker-py-ju3","title":"Programme codes share a namespace with the generic c/o/s type prefixes: 14% of harbor-house is silently optional and cr1's declared targets are all discarded","description":"Urb's type system is prefix-based (a type starting with 'c' is circulation, 'o'/'s' is outside) and programme room codes live in the SAME namespace, so any code whose name happens to start with c, o or s is silently reinterpreted as a generic type. Three separate consequences, none announced anywhere in the output:\\n\\n1. graph.check_space_counts line ~530 does 'if code[0].lower() in (\"c\",\"o\",\"s\"): continue' -- the code is SKIPPED ENTIRELY. Never required, never counted, no missing fail, no too-many fail.\\n2. Fitness.get_space_params returns the generic *_circulation / *_outside params BEFORE consulting self.spaces, so declared size/width/proportion are overridden.\\n3. dom.is_circulation / is_outside become true, changing the leaf's value rate, exempting it from crinkliness, and making it supply daylight to neighbours.\\n\\nharbor-house is affected; maple-court, health-centre and programme-house are namespace-clean.\\n\\n cr1 'Common Room with Fireplace' (c): size 80.0 -\u003e 0.0/14.0, width 6.0 -\u003e 2.4, proportion 2.0 -\u003e 1.5, ALL THREE overridden; is_circulation=True so value_rate 50 not 300.\\n of 'Staff Office' x2 (o): width/proportion overridden; is_outside=True; value_rate 100.\\n st1/st2 'Storage' (s): width/proportion overridden; is_outside AND is_circulation True; value_rate 100.\\n\\n5 of 37 room instances (14%) are silently optional. MEASURED CONSEQUENCE: in a 20k-eval run the two cr1 leaves converged to 32.9 and 17.1 m2 against a declared 80 m2, and produced no too-many-spaces fail despite count:1; of/st1/st2 are absent from the result entirely with zero fails, because nothing ever asked for them. Compounds with homemaker-py-2v1: cr1 is the single largest room in the programme and is classified circulation, so the x6 value gap pays the search to shrink it.","design":"Separate the namespaces. Cleanest is an explicit per-space 'class:' key in patterns.config (inside/circulation/outside) defaulting to inside, with the prefix rule used ONLY for untyped generic leaves the search creates -- programme codes then never collide regardless of spelling. A cheaper stopgap is a load-time validation error in programme.load_programme_dir that refuses a programme code starting with c/o/s, which at least converts a silent misread into a loud one. Renaming harbor's four codes would fix that one programme but leaves the trap armed for the next author.","acceptance_criteria":"A programme declaring a code starting with c/o/s either honours its declared params and count, or fails loudly at load. harbor-house re-baselined against its real 37-instance programme, and every DESIGN.md harbor fail count re-stated or annotated as measured against the 32-instance effective programme.","status":"closed","priority":0,"issue_type":"bug","assignee":"Claude","owner":"noreply@anthropic.com","created_at":"2026-08-26T08:26:37Z","created_by":"Claude","updated_at":"2026-08-26T09:05:11Z","started_at":"2026-08-26T08:55:30Z","closed_at":"2026-08-26T09:05:11Z","close_reason":"Shipped as loud validation + harbor rename rather than the class: key (DESIGN.md §39.3). The class: key was deliberately not built: auditing the prefix rule showed l/k/b/t carry adjacency semantics too, so re-plumbing the type system would invalidate the whole corpus for a problem whose damage is the silence, not the convention. programme.validate_codes raises on c/o/s codes from both parse paths; harbor cr1/of/st1/st2 renamed to fr1/ao/gs1/gs2 (neutral unused prefixes, prefix-sharing preserved); migrate_ju3_rename.py migrates pre-rename .dom files. Re-baselined at seed 1/20k: 57 fails on the 32-instance effective programme -\u003e 55 on the real 37-instance one, with all five previously-lost room instances now placed inside their declared sigma bands and zero fails naming them.","dependency_count":0,"dependent_count":0,"comment_count":0} -{"_type":"issue","id":"homemaker-py-2v1","title":"Connectivity is under-priced ~3x against the circulation-\u003ehabitable value gap: the objective is net-positive on severing the spine","description":"Sharper root cause than homemaker-py-ssz, isolated by the 38.6 A/B (which showed none of the three crinkliness modes removes the deletion incentive). Deleting a circulation leaf merges it into its sibling, converting corridor into habitable area. value_circulation=50 vs value_inside=300, so that is a flat 6x value gain. The only counter-pressure is the 'level N not connected' fail, worth 0.5x under value *= 0.5**len(failures). Break-even needs 0.5^k \u003c 50/300, i.e. k \u003e 2.58 -- severing must cost AT LEAST 3 fails to be net-negative, and it costs 1. Net incentive to sever = 6 * 0.5 = 3.0x in favour; measured 4.06x on a well-lit (q_crink=0.736) circulation leaf, so this is NOT the zero-exposure effect and is not fixable inside quality_uncrinkliness. This is the cleanest explanation of why 'level 0 not connected' and 'level 1 not connected' are still present in evolved-3M-nols-3, the best layout found after 1.7M evals: the search is being paid 3-4x to create them.","design":"Options: (a) emit connectivity fails with a multiplicity \u003e= 3 (cheapest, but stacks with the 1i8 cascade-weighting problem and is a magic number); (b) make the connectivity penalty multiplicative and explicit rather than riding the generic 0.5^n (a dedicated building_factor term, sized from the value-rate gap so it tracks value_circulation/value_inside instead of being hard-coded); (c) revalue circulation as infrastructure -- its worth is that it makes other rooms reachable, which the current per-leaf value rate cannot express; the principled version credits circulation with the access it provides rather than its own floor area. (c) is the architecturally correct one and the biggest change. Recommend measuring (a) first purely to confirm the mechanism (does the 3x threshold flip the deletion test?), then designing (b) or (c) properly.","acceptance_criteria":"Deletion test (experiments/diag_exposure_frontage.py value + the ssz A/B harness) shows lit and buried C/O deletions are no longer rewarded; then harbor-house reaches the 15-fail floor in materially fewer than 1.7M evals AND without 'level 0/1 not connected' in the result.","status":"open","priority":0,"issue_type":"bug","owner":"noreply@anthropic.com","created_at":"2026-08-26T07:37:39Z","created_by":"Claude","updated_at":"2026-08-26T07:37:39Z","dependency_count":0,"dependent_count":2,"comment_count":0} +{"_type":"issue","id":"homemaker-py-2v1","title":"Connectivity is under-priced ~3x against the circulation-\u003ehabitable value gap: the objective is net-positive on severing the spine","description":"Sharper root cause than homemaker-py-ssz, isolated by the 38.6 A/B (which showed none of the three crinkliness modes removes the deletion incentive). Deleting a circulation leaf merges it into its sibling, converting corridor into habitable area. value_circulation=50 vs value_inside=300, so that is a flat 6x value gain. The only counter-pressure is the 'level N not connected' fail, worth 0.5x under value *= 0.5**len(failures). Break-even needs 0.5^k \u003c 50/300, i.e. k \u003e 2.58 -- severing must cost AT LEAST 3 fails to be net-negative, and it costs 1. Net incentive to sever = 6 * 0.5 = 3.0x in favour; measured 4.06x on a well-lit (q_crink=0.736) circulation leaf, so this is NOT the zero-exposure effect and is not fixable inside quality_uncrinkliness. This is the cleanest explanation of why 'level 0 not connected' and 'level 1 not connected' are still present in evolved-3M-nols-3, the best layout found after 1.7M evals: the search is being paid 3-4x to create them.","design":"Options: (a) emit connectivity fails with a multiplicity \u003e= 3 (cheapest, but stacks with the 1i8 cascade-weighting problem and is a magic number); (b) make the connectivity penalty multiplicative and explicit rather than riding the generic 0.5^n (a dedicated building_factor term, sized from the value-rate gap so it tracks value_circulation/value_inside instead of being hard-coded); (c) revalue circulation as infrastructure -- its worth is that it makes other rooms reachable, which the current per-leaf value rate cannot express; the principled version credits circulation with the access it provides rather than its own floor area. (c) is the architecturally correct one and the biggest change. Recommend measuring (a) first purely to confirm the mechanism (does the 3x threshold flip the deletion test?), then designing (b) or (c) properly.","acceptance_criteria":"Deletion test (experiments/diag_exposure_frontage.py value + the ssz A/B harness) shows lit and buried C/O deletions are no longer rewarded; then harbor-house reaches the 15-fail floor in materially fewer than 1.7M evals AND without 'level 0/1 not connected' in the result.","status":"closed","priority":0,"issue_type":"bug","assignee":"Claude","owner":"noreply@anthropic.com","created_at":"2026-08-26T07:37:39Z","created_by":"Claude","updated_at":"2026-08-26T14:13:53Z","started_at":"2026-08-26T14:09:32Z","closed_at":"2026-08-26T14:13:53Z","close_reason":"MEASURED NULL — premise retracted (DESIGN.md §39.8). The arithmetic was right and the premise was wrong. Shipped connectivity_weight (EXPERIMENTAL, default 1.0 = flat rule, byte-identical) with connectivity_weight_for() deriving w=3 from value_inside/value_circulation rather than hard-coding it. At auto the §38.2 deletion test does not move AT ALL: 5/25 rewarded either way, median x0.26 vs x0.27 — because the connectivity fail count is UNCHANGED in every rewarded deletion (measured: 115-\u003e107 fails but 5-\u003e5 connectivity; 107-\u003e99 but 3-\u003e3; etc). Weighting a fail that never fires changes nothing. And when a deletion DOES break connectivity it is already punished: harbor 2 such deletions of 32, both punished (x0.00, x0.01); maple 5 of 32, all punished (x0.58..x0.07). Severing already costs 1-2 connectivity fails plus the cascade after them, which outweighs the x6 value gain. The x4.06 'well-lit circulation leaf' that motivated the bead was a deletion that did not change connectivity at all — it was rewarded for removing its own quality fails (§38.1's zero-value finding) and I misread it as a pricing mechanism. Flag kept default-off with the write-up per house style for a null lever.","dependency_count":0,"dependent_count":2,"comment_count":0} +{"_type":"issue","id":"homemaker-py-yql","title":"Why do level-not-connected fails persist in the best layout, if severing is already punished?","description":"Re-opened by homemaker-py-2v1 closing NULL (DESIGN.md §39.8). §38.2 claimed the search was PAID to sever the circulation spine; measurement refuted that — every deletion that actually breaks connectivity is already punished (x0.00 to x0.58 across harbor-house and maple-court, 0 of 7 rewarded). So the incentive is correct, yet 'level 0 not connected' and 'level 1 not connected' still survive in evolved-3M-nols-3, the best layout after 1.7M evals.\\n\\nThe evidence now points at REACHABILITY rather than incentive: connected topologies may be hard to construct and hard to hold onto under mutation, not insufficiently rewarded. Worth checking:\\n - what fraction of constructed seeds start connected at all (§39.7 measured 4/3/5 inaccessible-usable-space fails per 3 seeds, so: not many)\\n - whether a connected layout, once found, survives mutation or is quickly lost\\n - whether the constructive seeder's circulation dominating set actually guarantees connectivity, or only approximates it\\n - whether the §39.7 usage change (39% of adjacency edges now trimmed) makes connectivity materially harder to achieve, which would be a cost of that fix worth quantifying\\n\\nNOTE this is now measurable in a way it was not before §39.7: the fails actually fire on constructed seeds instead of being hidden by routes through store cupboards.","acceptance_criteria":"A measurement distinguishing 'rarely constructed' from 'constructed then lost' for level connectivity, and a named lever for whichever it is.","status":"open","priority":1,"issue_type":"task","owner":"noreply@anthropic.com","created_at":"2026-08-26T14:13:54Z","created_by":"Claude","updated_at":"2026-08-26T14:13:54Z","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"homemaker-py-sel","title":"Usage prefixes (b/t/l/k) are a second implicit namespace: 4 corpus rooms get another room's connectivity rules from their spelling","description":"§39.4 separated programme codes from the GENERIC structural types (C/O/S). It did not touch the other namespace sharing the first character: the USAGE prefixes b=bedroom, t=toilet, l=living, k=kitchen. These classify programme codes by first letter and are still prefix-based BY DESIGN (it is how Urb encodes room usage, and unlike the generic rule they never discard a requirement) -- but they are not inert.\\n\\ngraph.has_circulation deletes graph edges from them: a 'bedroom' loses its edges to living/kitchen/bedroom/toilet, a 'toilet' loses its edges to outside/living/kitchen/toilet, and b/t keep their LEAST popular circulation neighbour while l/k keep their MOST popular. fitness.access and the public-access check read them too. So a code that picks one up by accident is silently given another room's connectivity rules -- and connectivity is exactly where §38 located the residual.\\n\\nFour corpus rooms are misclassified by spelling alone:\\n la1 'Laundry Room' -\u003e living (harbor-house, harbor-house-l0, maple-court)\\n li1 'Library Corner' -\u003e living (harbor-house, maple-court)\\n br1 'Staff Room' -\u003e bedroom (health-centre)\\n tr1 'Treatment Room' -\u003e toilet (health-centre)\\n\\nMeasured on a constructed health-centre seed: tr1 (as a toilet) has its edge to the adjacent outside space O stripped from the circulation graph; br1 (as a bedroom) has its edge to t10 'Staff WC' stripped. Both feed has_circulation and therefore the 'N inaccessible usable space' / 'level N not connected' fails.\\n\\nReport it with: python experiments/audit_programme_config.py (usage-prefix section).","design":"FINAL SHAPE. usage is a plain ATTRIBUTE of the space definition, mandatory on every declared code, no prefix fallback and NO mapping table.\n\n spaces:\n ws1:\n name: Workshop Space # free text, building-specific\n usage: living # controlled, drives engine behaviour\n\nThe earlier 'usage_classes:' indirection table (binding author-coined names like craft-\u003eliving) is WITHDRAWN. It was wrong three ways: (a) an indirect name-\u003ebehaviour mapping living apart from the thing it describes is exactly the shape of the first-character prefix rule that §39 exists to remove, not relocate; (b) it is inconsistent with the schema — every other space property is a plain attribute (name/size/width/proportion/adjacency/level/requires_below/count/share/interchange/co_locate) and no key in patterns.config is an indirection table; (c) the need it served is already met, because 'programmes are building specific' is about what a room is CALLED and name: is already free text, whereas usage: records ACCESS REQUIREMENTS, which are not building-specific — a craft room and a lounge have the same ones, which is the entire reason the key exists.\n\nRULE THAT FALLS OUT: a usage value exists if and only if the engine treats it differently somewhere. Config selects among behaviours; it cannot invent them. A genuinely new access class means writing code, and at that point the value joins the controlled set for everyone. utility passes this test — not on edge-stripping (identical to bedroom today) but because it is intended to drive derive_interchange_classes; distinct behaviour in a second subsystem is a real difference, an alias is not.\n\nVocabulary: living, kitchen, bedroom, toilet, utility, none. Missing usage on a declared code = load error naming the code. Unknown value = load error.\n\nMutation-safety (the original objection): usage is CODE-level, so usage_of(leaf.type) is looked up fresh on every read exactly as size/width/adjacency already are. Never stamp it on a leaf — 51 sites assign leaf.type, and share/share_type plus the r5a resurrection bug are the precedent for why leaf-level attributes go stale.\n\nAssignments for all 52 corpus codes: experiments/usage_map_proposal.yaml (living 12, bedroom 17, utility 11, toilet 7, kitchen 2, none 3; zero unresolved).","acceptance_criteria":"A programme can declare a room's usage explicitly; the prefix rule applies only where nothing is declared; audit_programme_config reports no unintended usage classification across the corpus; re-baselined with an A/B.","notes":"ALL 52 CORPUS CODES NOW ASSIGNED (experiments/usage_map_proposal.yaml): living 12, bedroom 17, utility 11, toilet 7, kitchen 2, none 3. Zero unresolved.\n\nRulings received: li1 Library Corner + br1 Staff Room -\u003e living (same access requirements); tr1 Treatment Room -\u003e bedroom; la1 Laundry -\u003e utility; zt1 Sterilisation -\u003e utility; ph1 Pharmacy -\u003e bedroom (private room, not public, like an office); n 'Neighborhood' -\u003e bedroom (a communal sleeping area, much like a dormitory); gh1 Greenhouse -\u003e living (grows plants but a living area like a conservatory); ws1 Workshop -\u003e living CONDITIONALLY (building-specific: communal craft room vs maintenance area; both corpus programmes carrying it are communal living facilities).\n\nDESIGN DECISION 1 — utility is a DISTINCT value, not an alias for bedroom. Same edge-stripping today (identical access requirements) but separately declared, because (a) they are very different uses and the config should read truthfully, and (b) it gives programme.derive_interchange_classes (§13/§26, homemaker-py-9o5) a natural axis: bedroom-class and utility-class leaves could be interchangeable DURING search and collapse to their real use at scoring time — exactly the superposition relaxation that machinery already implements. Worth building the usage key with that hook in mind.\n\nDESIGN DECISION 2 — vocabulary controlled but NOT closed. The earlier 'closed enum, unknown value errors' recommendation is withdrawn ('programmes are building specific, so it would be nice to have a controlled vocabulary, but not entirely necessary'). Proposed: the six known names drive engine behaviour; a programme may coin its own (usage: craft) provided it binds it in the same file via usage_classes: {craft: living}. An unbound name is a load error, so naming stays free without ever letting an unrecognised usage fall through to a silent default.\n\nVERIFIED — Brand adjacency point is NOT an engine bug. fitness._evaluate_full runs check_adjacency against graph_base_pre, the UNFILTERED graph, so a declared adjacency requirement is satisfied by a neighbouring room regardless of what has_circulation strips. The stripping only denies ROUTING, which is correct. So 'a toilet adjacent to a bedroom is a positive even if there is no door' is already expressible -- but it is only scored where DECLARED, and 3 of 4 real programmes never declare it: only programme-house has t1 -\u003e adjacency [b1]. harbor-house (t vs r/n), maple-court (t/tt vs r/n) and health-centre (t9/t10 vs tr1) do not. Filed separately as homemaker-py-adj.","status":"closed","priority":1,"issue_type":"bug","owner":"noreply@anthropic.com","created_at":"2026-08-26T10:06:54Z","created_by":"Claude","updated_at":"2026-08-26T13:38:20Z","closed_at":"2026-08-26T13:38:20Z","close_reason":"SHIPPED (DESIGN.md §39.7). usage: is a mandatory plain attribute of the space definition; vocabulary living/kitchen/bedroom/toilet/utility/none; missing or unknown is a load error from both parse paths. Code-level so it survives retype, never stamped on a leaf. has_circulation, fitness.access and the public-access check all key on declared usage; fitness._t0 deleted — no first-character type test remains anywhere. All 107 corpus entries migrated. MEASURED: connectivity model was ~4x too permissive; edges trimmed prefix-inferred vs declared, 3 seeds: harbor 18(9%)-\u003e79(39%), health-centre 12(8%)-\u003e59(40%), maple 53(17%)-\u003e123(39%); inaccessible fails 0-\u003e4, 2-\u003e3, 1-\u003e5. Harbor re-baseline seed 1/20k: 58 (15h/43s) -\u003e 61 (16h/45s), now reporting inaccessible-usable-space x2 plus level 0 and level 1 not connected — the count rose because the objective got honest.","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"homemaker-py-ut5","title":"Update the 2v1 acceptance target: harbor's 15-fail reference was measured pre-ju3 against the 32-instance effective programme","description":"DESIGN.md 38.7 fixes the acceptance test for homemaker-py-2v1 as 'harbor-house reaches its known 15-fail floor in materially fewer than 1.7M evals, and without level 0/1 not connected'. That 15-fail figure comes from evolved-3M-nols-3, measured before homemaker-py-ju3 against the 32-instance EFFECTIVE programme (cr1/of/st1/st2 silently dropped or mis-parameterised). Against the real 37-instance programme the number will differ, so the target as written is not measurable any more.\\n\\nNeeded: migrate evolved-3M*.dom with experiments/migrate_ju3_rename.py, rescore against the renamed programme, and restate the 2v1 acceptance figure. The 39.3 re-baseline (55 fails, seed 1, 20k evals) is the new near-term reference but is not the long-budget floor.","acceptance_criteria":"evolved-3M*.dom committed and migrated; its post-ju3 fail count recorded in DESIGN.md; the 2v1 acceptance figure restated against it.","status":"open","priority":1,"issue_type":"task","owner":"noreply@anthropic.com","created_at":"2026-08-26T09:05:23Z","created_by":"Claude","updated_at":"2026-08-26T09:05:23Z","dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"homemaker-py-hxi","title":"Buried circulation and outside space are negative-value: search is rewarded for deleting the circulation spine","description":"Direct consequence of the zero-exposure bug. Measured on a constructed harbor-house seed: deleting a buried O leaf improved the raw score 85x and removed 7 fails; deleting a buried C leaf improved it 62x and removed 6 fails. Programme rooms are held in place ONLY by the missing-space fail cascade, not by contributing value -- deleting a buried k1/da1/m costs +15 fails, so they stay, but nothing positive keeps them. Circulation and outside leaves carry no missing-space requirement, so nothing keeps them at all. Observed live: in a 20k-eval harbor-house run, undivide/core_undivide account for a large share of recorded improvements (16 occurrences in the log) -- the search is literally deleting circulation to score better. This explains three prior negative results as a single mechanism: 18 graded circulation-connectivity (a tie-break signal cannot beat a 60x scalar gradient), 21/22 bridge_circulation (the operator inserts corridor leaves the objective immediately punishes), and the 'level N not connected' hard fails surviving \u003e1M evals in the 3M run.","notes":"Depends on the zero-exposure fix; may need no separate fix if (a)/(c) there restores a value gradient for circulation. Worth re-running the 18 and 21/22 A/Bs afterwards -- both may have been measuring a broken gradient rather than a bad idea.","status":"open","priority":1,"issue_type":"bug","owner":"noreply@anthropic.com","created_at":"2026-08-25T23:14:40Z","created_by":"Claude","updated_at":"2026-08-25T23:14:40Z","dependencies":[{"issue_id":"homemaker-py-hxi","depends_on_id":"homemaker-py-ssz","type":"blocks","created_at":"2026-08-25T23:15:12Z","created_by":"Claude","metadata":"{}"},{"issue_id":"homemaker-py-hxi","depends_on_id":"homemaker-py-2v1","type":"blocks","created_at":"2026-08-26T07:37:47Z","created_by":"Claude","metadata":"{}"}],"dependency_count":2,"dependent_count":0,"comment_count":0} diff --git a/DESIGN.md b/DESIGN.md index 0dc8979..d7c95c8 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -4929,10 +4929,18 @@ favour, against a measured ×4.06. **The connectivity fail is under-priced by roughly 3×, so the objective is net-positive on destroying the circulation spine even when the circulation is perfectly daylit.** -That is the cleanest available explanation of why `level 0 not connected` and -`level 1 not connected` are still present in the best layout found after -1.7 M evals: the search is not failing to fix them, it is being paid ×3–4 to -create them. +**RETRACTED — see §39.8.** The inference above ("the objective is net-positive +on severing the spine") does not survive measurement. It assumed severing costs +exactly one failure; it does not. Every deletion that actually breaks +connectivity is already punished — measured ×0.00 to ×0.58 across harbor-house +and maple-court, not one rewarded. The ×4.06 figure above is real but was +measured on a deletion that did **not** change the connectivity fail count, so +it is not evidence for this mechanism. The deletions that are rewarded are +rewarded because they remove the deleted leaf's OWN quality failures (7–9 of +them), which is §38.1's zero-value finding, not a connectivity mispricing. + +Why `level 0/1 not connected` persist in the best layout is therefore still +open, but it is not that the search is paid to create them. Together these retro-explain three prior results as one mechanism, and suggest two of them were measuring a broken gradient rather than a bad idea: @@ -5422,3 +5430,67 @@ missed, because consulting rooms and storage stood in for them. With that substitution gone, `homemaker-py-2v1` (connectivity priced at ×0.5 against a ×6 circulation→habitable value gap) is the remaining half of the same problem — and now measurable, because the fails it should be preventing actually fire. + +### 39.8 `homemaker-py-2v1` connectivity weighting — MEASURED NULL, premise retracted + +§38.2 concluded that the objective is net-positive on severing a level's +circulation: merging a corridor into a habitable sibling gains +`value_inside / value_circulation` = ×6, while `level N not connected` costs +only ×0.5, so break-even needs `0.5^w < 50/300`, i.e. w > 2.58 — "severing must +cost at least 3 fails and costs 1". **The arithmetic is right and the premise is +wrong.** + +**What shipped anyway** (EXPERIMENTAL, default off, byte-identical): +`fitness.connectivity_weight_for(value_inside, value_circulation)` returns the +smallest weight making severing net-negative — 3.0 at the defaults, *derived* +from the rates rather than hard-coded, so it tracks them if either is retuned. +`conf["connectivity_weight"]` takes `1.0` (default, the flat rule), `"auto"`, or +an explicit number, and counts each connectivity failure as w failures in the +`0.5^n` penalty. `is_connectivity_fail` identifies the two strings. + +**The measurement.** At `auto` (=3) the §38.2 deletion test does not move at +all: 5/25 deletions rewarded either way, median ×0.26 vs ×0.27. The reason is +immediate once looked for — **the connectivity fail count is unchanged in every +rewarded deletion**: + +| seed | deleted | | score | fails | connectivity fails | +|---|---|---|---|---|---| +| 0 | `rlrrr` `O` | buried | ×238 | 115 → 107 | 5 → **5** | +| 0 | `rrrl` `O` | lit | ×346 | 115 → 106 | 5 → **5** | +| 1 | `lrlll` `cr1` | lit | ×257 | 107 → 99 | 3 → **3** | +| 2 | `rlrrl` `O` | buried | ×127 | 78 → 71 | 3 → **3** | + +Weighting a failure that never fires changes nothing. And when the deletion +*does* break connectivity, the objective already punishes it — every such case +across harbor-house and maple-court, 4 seeds each: + +| programme | deletions sampled | break connectivity | of those, rewarded | +|---|---|---|---| +| harbor-house | 32 | 2 | **0** (×0.00, ×0.01) | +| maple-court | 32 | 5 | **0** (×0.58 … ×0.07) | + +So severing is already net-negative: it costs 1–2 connectivity failures *plus* +the cascade that follows them (inaccessible space, broken adjacency), and that +total already outweighs the ×6 value gain. The flat rule was never the problem. + +**Where §38.2 went wrong.** The ×4.06 "well-daylit circulation leaf" that +motivated the whole bead was a deletion that did **not** change the +connectivity fail count. It was rewarded for removing the leaf's own quality +failures — §38.1's zero-value finding — and was misread as evidence for a +pricing mechanism. Two lessons, both cheap to state and expensive to learn: a +plausible closed-form arithmetic is not a measurement, and when a fix produces +*exactly* no effect, suspect the premise before the implementation. + +**What is still true from §38.** §38.1 (buried leaves score a hard quality of +zero and contribute no value) and §38.3 (the frontage budget) are direct +measurements and stand. §39.7's finding — that the connectivity model was ~4× +too permissive — also stands and is the more useful lever: it made the fails +*fire*, where this bead would only have made them *cost more*. + +**Verdict: NULL.** The flag stays default off with this write-up, per house +style for a measured-null lever. `homemaker-py-2v1` is closed. Why +`level 0/1 not connected` survive in the best-known layout is re-opened as a +question (`homemaker-py-yql`) — the evidence now says it is a reachability problem +(connected topologies are hard to construct and hold onto), not an incentive +one. It is newly measurable: §39.7 made the fails fire on constructed seeds +instead of being hidden by routes through store cupboards. diff --git a/src/homemaker_layout/fitness.py b/src/homemaker_layout/fitness.py index 3b3f3ce..60bed20 100644 --- a/src/homemaker_layout/fitness.py +++ b/src/homemaker_layout/fitness.py @@ -118,6 +118,40 @@ _SOFT_FAIL_MARKERS = ( ) +# homemaker-py-2v1 (DESIGN.md §39.8) — the fails that punish severing a level's +# circulation. These are the ONLY counter-pressure against a structural x6 gain: +# deleting a circulation leaf merges it into its sibling, converting corridor +# into habitable area, and value_inside/value_circulation is 300/50. +_CONNECTIVITY_FAIL_MARKERS = ("not connected", "inaccessible usable space") + + +def is_connectivity_fail(fail: str) -> bool: + """True for a level-connectivity failure (``level N not connected`` / + ``N inaccessible usable space``).""" + return any(m in fail for m in _CONNECTIVITY_FAIL_MARKERS) + + +def connectivity_weight_for(value_inside: float, value_circulation: float) -> float: + """Smallest integer weight at which severing circulation is net-NEGATIVE. + + Merging a circulation leaf into a habitable sibling multiplies value by + ``value_inside / value_circulation`` (x6 at the defaults). One failure costs + x0.5. So the penalty only outweighs the gain once + ``0.5**w < value_circulation / value_inside``, i.e. + ``w > log(vc/vi) / log(0.5)`` — 2.58 at the defaults, hence 3. + + Derived from the value rates rather than hard-coded, so the two stay in step + if either rate is ever retuned. + """ + import math + if value_inside <= 0 or value_circulation <= 0: + return 1.0 + ratio = value_circulation / value_inside + if ratio >= 1.0: # circulation already worth as much + return 1.0 + return float(math.ceil(math.log(ratio) / math.log(0.5))) + + def classify_fail_tier(fail: str) -> str: """Return ``"hard"`` or ``"soft"`` for one failure string. @@ -390,6 +424,18 @@ class Fitness: # leaf with no daylit wall. "urb" (default) = stock hard 0.0, byte- # identical to every prior run. "floor"/"compact_ok"/"exempt_circulation" # are the three candidate repairs — see quality_uncrinkliness. + # homemaker-py-2v1 (§39.8), EXPERIMENTAL: 1.0 (default) is the flat rule, + # byte-identical to every prior run. "auto" derives the smallest weight + # that makes severing circulation net-negative; a number sets it explicitly. + cw = self.conf("connectivity_weight") + if cw is None: + self._connectivity_weight = 1.0 + elif isinstance(cw, str) and cw.lower() == "auto": + self._connectivity_weight = connectivity_weight_for( + float(self.conf("value_inside")), + float(self.conf("value_circulation"))) + else: + self._connectivity_weight = float(cw) self._crinkliness_mode = str(self.conf("crinkliness_mode") or "urb") if self._crinkliness_mode not in ( "urb", "floor", "compact_ok", "exempt_circulation"): @@ -1925,8 +1971,23 @@ class Fitness: building_factor = self.evaluate_building(root, tracking) value *= building_factor - # 0.5^n failure penalty (programme-driven mode, not 0.1^n) - value *= 0.5 ** len(failures) + # 0.5^n failure penalty (programme-driven mode, not 0.1^n). + # + # homemaker-py-2v1: connectivity failures may carry EXTRA weight. Under + # the flat rule every failure costs x0.5, but severing a level's + # circulation *gains* value_inside/value_circulation = x6 (the corridor + # becomes habitable area when it merges into its sibling), so the + # objective was net-positive on destroying the spine — measured x4.06 on + # a well-daylit circulation leaf. ``connectivity_weight`` counts each + # connectivity fail as w failures; ``"auto"`` derives the smallest w that + # makes severing net-negative from the value rates themselves. + w = self._connectivity_weight + if w != 1.0: + n_conn = sum(1 for f in failures if is_connectivity_fail(f)) + n_other = len(failures) - n_conn + value *= 0.5 ** (n_other + w * n_conn) + else: + value *= 0.5 ** len(failures) score = value / cost if cost != 0.0 else 0.0 return score, tuple(sorted(failures)), grade diff --git a/tests/test_fitness.py b/tests/test_fitness.py index 1d6800d..4c66a76 100644 --- a/tests/test_fitness.py +++ b/tests/test_fitness.py @@ -531,3 +531,29 @@ def test_crinkliness_exempt_circulation_only_exempts_circulation(): def test_crinkliness_mode_unknown_raises(): with pytest.raises(ValueError, match="crinkliness_mode"): _stub_fit("nonsense") + + +# --------------------------------------------------------------------------- # +# homemaker-py-2v1 / DESIGN.md §39.8 — connectivity_weight (EXPERIMENTAL, NULL) +# --------------------------------------------------------------------------- # +def test_connectivity_weight_defaults_to_flat_rule(): + """Default must reproduce the flat 0.5^n penalty exactly.""" + assert Fitness(conf={})._connectivity_weight == 1.0 + + +def test_connectivity_weight_auto_is_derived_from_the_value_gap(): + """Not a magic number: the smallest w making 0.5^w < value_circulation / + value_inside, so it tracks the rates if either is retuned.""" + from homemaker_layout.fitness import connectivity_weight_for + assert connectivity_weight_for(300.0, 50.0) == 3.0 # 0.5^3 < 1/6 < 0.5^2 + assert connectivity_weight_for(100.0, 100.0) == 1.0 # no gap, no extra weight + assert connectivity_weight_for(400.0, 50.0) == 3.0 # 1/8 -> exactly 3 + assert Fitness(conf={"connectivity_weight": "auto"})._connectivity_weight == 3.0 + + +def test_is_connectivity_fail_matches_both_strings(): + from homemaker_layout.fitness import is_connectivity_fail + assert is_connectivity_fail("level 0 not connected") + assert is_connectivity_fail("1 inaccessible usable space") + assert not is_connectivity_fail("0/llr crinkliness") + assert not is_connectivity_fail("missing required space: b1")