Files
ARCADIA-Studio/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE.md
T

12 KiB

Independent complete-target rename oracle

2026-09-24. Contract: root harness/analysis-mixed-rename-plan-contract-20260924.md; fixture source base ee500908e3d77182ddd54e12524f9b6c6eb43b60 in .local/as3batch. This report authors complete desired-name sets and original-coordinate physical edits from literal source roles. It does not infer expectations from parser/index/plan/emitter outputs. No source/tests were edited; no Cargo, archived evaluator, product execution, commit or Gitea operation was performed.

Report-only rename_plan_bytes.py reconstructs the existing rich literal, checks explicit hard-coded physical tuples against raw slices, pins the repaired category file, computes Unicode/CRLF endpoints and separate removed/replacement totals. It never imports application code or discovers name occurrences by scanning an index. Its successful execution establishes byte arithmetic only, not semantic admission/runtime acceptance. The tables are initial exhaustive oracles; implementation and parent own resulting tests and runtime gates.

Qualified identities and complete rich target

Use existing id(n) (decimal digits formatted in UUID suffix), not Id::from_u128(n). G(n)=Global(id(n)); P(c,n)=Parameter(calculation id(c), parameter id(n)). Canonical files: 0=a.arcadia, 1=b.arcadia, 2=main.arcadia; entry remains main despite textual include order b then a. Base OA lengths213/213/474 (total900); SA213/213/548 (total974).

Start with independently constructed rich_model(layer) and change only the following aliases/parameter names. This is the complete changed-name map, not selected sample targets; every other field is exactly the original desired model field.

Target Old Desired
G1 p w
G2 w p
G3 v n
G4 n v
G5 d z
G10 f g
G11 g f
P(10,1) x y
P(10,12) y x
P(11,1) x y
P(11,12) y x
G6, SA only s u

Global swaps are validated simultaneously; no sequential intermediate collision is acceptable. Parameters swap independently within f/g identity, even as their calculation aliases swap. P(10,1), P(11,1) and G1 share the same raw UUID but never authority. An additional isolated valid case G1 p→x has exactly one edit (2,19,20), despite both calculations already having scoped x names. Negative G1 p→w alone collides with unchanged G2; P(10,1) x→y alone collides with unchanged P(10,12). Neither may yield a partial plan.

Entire rich physical map

Replacement is derived from the target table above. Half-open spans select whole name tokens, never @/$, colon, trivia or prose. OA has all27 rows; SA adds the last row for28. Same numerical spans in different canonical files are distinct keys.

File Start..end Target Original token / role
0 12..13 G10 f header
0 68..69 P(10,1) x declaration
0 128..129 P(10,12) y declaration
0 203..204 P(10,1) x body use
0 208..209 P(10,12) y body use
1 12..13 G11 g header
1 68..69 P(11,1) x declaration
1 128..129 P(11,12) y declaration
1 203..204 P(11,1) x body use
1 208..209 P(11,12) y body use
2 19..20 G1 p project header
2 122..123 G4 n node header
2 177..178 G5 d node diagram reference
2 189..190 G3 v ordinary→typed reference
2 206..207 G3 v property header
2 269..270 G2 w typed→ordinary subject
2 291..292 G10 first f call
2 293..294 P(10,12) first f y label
2 299..300 P(10,1) first f x label
2 303..304 G11 nested g call
2 305..306 P(11,1) g x label
2 311..312 P(11,12) g y label
2 321..322 G10 repeated f call
2 323..324 P(10,1) second f x label
2 329..330 P(10,12) second f y label
2 350..351 G2 w work header
2 412..413 G5 d diagram header
2, SA only 490..491 G6 s system header

The reordered/repeated labels are intentional: main expression is @f(y: 2, x: @g(x: 3, y: 4)) + @f(x: 5, y: 6). Header and both call labels must track qualified identity, not source position or current alias string. OA per-file removed/replacement counts5/5,5/5,17/17 preserve all900 bytes; SA final main has18/18 and total974.

Unicode/CRLF variant: independently prefix each original file with // 雨\r\n (8 bytes) and replace LF by CRLF. Map each endpoint b to 8+b+LF_count(original[..b]). File0 and1 rows become20..21,77..78,138..139,214..215,219..220. Main rows in table order become28..29,133..134,188..189,200..201,218..219,281..282,303..304,305..306,311..312,315..316,317..318,323..324,333..334,335..336,341..342,363..364,426..427; SA system505..506. Lengths226/226/491 OA (943),226/226/565 SA (1017). Same target set and edit counts; prefix and CRLF bytes never become edits.

Entire ordinary-category target and physical map

Use repaired 2152-byte ordinary_index/tests/fixtures/categories.arcadia, SHA256 3943579866157c7b5d95ce9edcb2d643058826b9af44257557e2864f130d15fc. Earlier block-comment fixture hash is superseded; the repair is byte-neutral and retains all numeric tuples. File0 is its sole canonical file. All targets below are global; R=Q=15, M=36, E=0.

Target Old→desired Every physical span for that target
G1 p→a 19..20
G2 a→p 168..169;344..345
G3 child→implicit 249..254;625..630;992..997;1741..1746
G4 implicit→child 369..377;640..648;1882..1890
G5 s→link 487..488;1003..1004
G6 link→s 561..565;741..745;789..793;885..889
G7 d→note 664..665
G8 note→d 818..822
G9 t→q 925..926
G10 q→t 1328..1329;1577..1578;1855..1856;2004..2005
G11 sub→use 1422..1425;1617..1620;1712..1715
G12 use→sub 1391..1394;1514..1517;2029..2032
G13 left→right 1487..1491;1648..1652;2047..2051
G14 right→left 1397..1402;1789..1794;2092..2097
G15 context→ctx 1935..1942

Sort these explicit tuples by physical key for complete-map comparison. Removing127 old token bytes and adding120 replacement bytes yields 2145 final bytes. Changed desired-name bytes45 (original catalog49). This includes project/nested activity/function/relation/diagram/artifact/trace/process/occurrence/context headers and all authored parent, route, view-option, owner, trace and contextual-reference positions. The parent marker at323 starts a reference extending through345; only344..345 is replaceable across the real // @noise child\n comment. No edit covers its comment text. The implicit parent has no authored reference. Historical Named uuid remains untouched even though it equals live G3. Project/display/description text, artifact URI docs/@child.md, contextual guard @child, and trace historical names/descriptions are unchanged. The header-only context rename still has one mandatory physical edit.

Phase peaks and actual inherited cap pair

Let B be the admitted authored-owner entry usage; do not substitute a fresh/tightened budget after admission. Separate dimensions remain unchanged: occurrence counters, copied text, parsing/numeric/frame work. Equality scratch E drops before name-map growth; namespace set Q drops before edit-map growth.

Case E Q R M Equality added peak Names+namespace Names+edits / retention Actual added peak
Rich OA all 15 11 11 27 15 22 38 38
Rich SA all 15 12 12 28 15 24 40 40
Categories all 0 15 15 36 0 30 51 51
Rich OA project-only p→x 15 11 1 1 15 12 2 15
Rich OA no-op 15 11 0 0 15 skipped 0 15
Categories no-op 0 15 0 0 0 skipped 0 0

Use rich OA all-name swaps for the primary entry cap pair. Let L be the original resolved baseline. Typed retention59 + ordinary retention6 gives B=L+65. Actual planning peak B+38=L+103; failing cap B+37=L+102. Existing inherited-profile resolver succeeds at L+97 (established original index_tests::new_maps_keep_baseline_and_scope_reservations_and_peak_scratch), typed peak L+98, ordinary peak L+93. Thus both L+102 and L+103 clear every predecessor phase, and differ only on the final edit reservation. With canonical physical insertion order the final row is main412..413, G5; if implementation traverses families in a different order, the failing row must follow its actual insertion sequence, not be guessed from eventual BTree order. Success retains exactly38 extra entries and no copied text/occurrences. Parent must verify actual refusal phase/diagnostic and success at these inherited limits.

The original rich no-op E15 profile B+15=L+80 would refuse earlier than typed peak98; do not claim it isolates comparison scratch. Use unrestricted entries for no-op semantic assertions. Category all-plan peak B+51 is adequate for a second straightforward storage case, but the accepted rich case already resolves the predecessor-bound uncertainty without larger literals. Wide/deep equality tests must author their old E from literal node construction, retain exactly that scratch through equality, and independently demonstrate all earlier peaks before claiming an E/E-1 inherited cap boundary. No such unverified boundary is asserted here.

Combined all-file sizing oracle

Separate rich OA fixture: change only the original sole node header alias n to31 n characters. a and b remain213 bytes each; main becomes504; total input 930. Original physical changed tokens are exactly (0,12,13)→G10, (2,122,153)→G4, (2,321,322)→G10, (2,351,352)→G10. Derive desired model from that original model, changing G4 back to n and G10 as below; everything else remains equal. Q11,R2,M4,E15, retention6, added peak15, so keep entry cap ample.

Desired G10 File a: removed/add/final File b untouched Main: removed/add/final Complete final Typed-only intermediate
renamed_f (9 bytes) 1/9/221 213 33/19/490 924 954
renamed_func (12 bytes) 1/12/224 213 33/25/496 933 963

With inherited complete byte limit930, the first must succeed despite the typed-only954; the second must refuse because933>930. Omitting unchanged b would falsely reduce the negative total to720 and admit it. Sum removed then replacement separately per file, subtract before add, then include all final files. The changed-name byte sums10 and13 fit the same bound. Original input930 fits the input-size limit; parent must confirm predecessor ledger text reservations under this same inherited profile rather than bypassing admission. This is planned sizing only, not emission or reparsing of edited source.

Required comparison discipline

Compare complete target/name and physical maps—not just lengths or sample rows. Desired is externally borrowed unchanged; owner still provides exact entry, canonical paths, file set, raw bytes, full original model, warnings and inherited usage. A no-op still validates all non-name fields and reserves E where needed. Use separate unsupported mutations for every contract field group, including changed IDs/keys, parameter order/count/type, expression variants/list/call sizes, and all non-name diagram/artifact/trace payloads. Target-only wide/deep trees must refuse without undercharging traversal. Signed-zero equivalence follows existing whole-model equality but grants no authority to rewrite source. Missing/wrong-target/extra/overlap corruption must reject the complete plan, and stale untouched files must fail complete-bundle authority. These obligations are not satisfied by these positive byte tables alone; source critic and runtime acceptance remain separate.