diff --git a/harness/DECISIONS.md b/harness/DECISIONS.md index 483ef6af..8bac6fce 100644 --- a/harness/DECISIONS.md +++ b/harness/DECISIONS.md @@ -586,3 +586,31 @@ with separately reported new usage and aggregate live-storage accounting. An independent fresh ledger must not hide retained output or old state. Execution ownership/readmission seams remain separate required implementation; this decision does not label a read-only plan as accepted rewritten source. + +## 2026-09-24 — carry output storage through actual verification + +The [execution source map](analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-SOURCE-MAP.md) +identifies the next boundary: output buffers already coexist with parsing, so +adding a retained-output baseline only at resolution checks too late. Preserve +the exact per-snapshot Limits and ProjectLimits, explicitly drop consumed old +auxiliary state, and carry surviving output storage through verification. +The final comparison must include aliases and parameter names; the planning +gate deliberately omits them and cannot establish accepted rewritten output. + +We considered authenticating exact output bytes, then reserving a conservative +parser envelope derived from the unchanged syntax topology. The +[independent feasibility investigation](analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-ENVELOPE-FEASIBILITY.md) +found useful partial bounds but no complete safe, useful aggregate formula. +Finishing it would duplicate parser lifecycle knowledge across expression +tasks, name sets, projection buffers, string decoding and include traversal. +Select explicit carried storage accounting at actual growth/handoff seams for +the next bounded design instead. Revisit an envelope only if a small, stable +source-derived proof demonstrates useful caps; do not use unexplained byte or +node multipliers. This chooses a direction, not an implemented execution API. + +The [domain audit](analysis-mixed-rename-execution-20260924/CARRIED-STORAGE-DOMAIN-AUDIT.md) +keeps the declared metric explicit: logical auxiliary slots/text are distinct +from model/serde/raw-validator heap, allocator capacity and process RSS. The +exploratory allocation inventory is not a requirement to meter all heap usage. +The successor contract must reconcile that domain before selecting growth +hooks or claiming an aggregate pre-allocation guarantee. diff --git a/harness/STATE.md b/harness/STATE.md index 8fb9003f..392304bc 100644 --- a/harness/STATE.md +++ b/harness/STATE.md @@ -265,11 +265,18 @@ prior outcomes and failure bodies unchanged; formatting retains the identical eight inherited blocks. Initial9-pass/4-fail fixture evidence and exact test-only repairs are preserved. Both occurrence families now retain complete original authority, but no rename composition or public edit capability follows yet. -The next [whole-target rename planning contract](analysis-mixed-rename-plan-contract-20260924.md) -is accepted after source mapping and independent critique. It specifies complete -non-name equality, simultaneous qualified namespaces, one original-coordinate -edit map and explicit comparison scratch. Implementation and output execution -remain unverified; live ownership and acceptance belong in issue7. +The [whole-target rename planning contract](analysis-mixed-rename-plan-contract-20260924.md) +is implemented privately at **18073a6f2eabce83fc83997f094e331eec835a16**. +Its [Windows evidence and independent review](experiments/analysis-mixed-rename-plan-20260924/README.md) +verify all 17 new tests and strict core Clippy on 551 unchanged inputs. The full +246-name run remains **230 passed / 16 failed**, preserving all prior outcomes; +formatting retains identical inherited failures. Complete non-name comparison, +simultaneous namespaces, exact merged edits, inherited caps and combined sizing +are verified. The scoped planner comparison/drop test passes on 128 KiB; +separate full-pipeline parsing/setup overflows remain explicitly unresolved. +Output emission/readmission is not implemented. The next accounting direction +and rejected envelope approach are documented in [DECISIONS.md](DECISIONS.md); +live ownership and acceptance remain in issue7. The preceding Project [Windows evidence](experiments/analysis-mixed-project-20260924/README.md) distinguishes runtime source **71cadfa0cd0e112caa29588d2494753301f3cb6c** from the formatting-only aaec successor. Strict core all-target Clippy, actual listing diff --git a/harness/analysis-mixed-rename-execution-20260924/.gitattributes b/harness/analysis-mixed-rename-execution-20260924/.gitattributes new file mode 100644 index 00000000..4833361c --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/.gitattributes @@ -0,0 +1,3 @@ +*.md -text +*.py -text +*.json -text diff --git a/harness/analysis-mixed-rename-execution-20260924/CARRIED-STORAGE-DOMAIN-AUDIT.md b/harness/analysis-mixed-rename-execution-20260924/CARRIED-STORAGE-DOMAIN-AUDIT.md new file mode 100644 index 00000000..ddc75d51 --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/CARRIED-STORAGE-DOMAIN-AUDIT.md @@ -0,0 +1,111 @@ +# Carried storage domain audit + +2026-09-24. Read-only inspection of private source `18073a6f2eabce83fc83997f094e331eec835a16` in `.local/as3batch`. This is a design audit, not an accepted contract or implemented carried parser. No source changes, Cargo, commits or Gitea actions. Parent owns scope and acceptance decisions. Code paths below are relative to `crates/oa-core/src/`. + +## Finding and recommended boundary + +Carry the **existing three-dimensional logical auxiliary metric**, not a newly inferred whole-heap metric. Preserve `(entry_slots, lower_occurrence_slots, owned_in_scope_text_bytes)` and the exact inherited policy. A successor must not hide emitted output behind a fresh zero-baseline parser/resolver ledger. Conversely, neither user editing requirements nor accepted contracts require accounting allocator capacity, every serde allocation, BigInt limbs, compiler stack frames, RSS or raw validator heap. + +The narrow next dependency can introduce a private, constructor-controlled surviving baseline plus aggregate checks at the current parser and resolver phase boundaries. It must say precisely whether it preserves the existing **phase-check** guarantee or additionally strengthens selected parser producers to pre-growth reservation. Existing source does not establish preallocation accounting for every parser transient or retained syntax String. Therefore “all parser allocations already counted; just seed resolve” and “must instrument all heap allocation before proceeding” are both unsupported conclusions. + +The smallest honest proposal has two distinct decisions: + +1. Adopt carried ownership/aggregate **within the existing declared domain**, preserving the existing metric and explicit exclusions. Keep all current syntax/work counters separate from the carried live auxiliary baseline. +2. If the execution contract requires aggregate refusal **before each counted parser representation grows**, add narrowly named hooks for those representations, or a proven conservative reservation before their production. This is an explicit temporal strengthening of current parser checks, not permission to broaden the domain to model/serde/validator heap. Do not claim it is already implemented. + +## Authority and the actual user need + +The user-owned application goal requires graphical/text/API editing parity and reliable persistence; it does not specify a physical heap meter. Accepted original-span/mixed contracts derive resource, provenance and failure invariants supporting that need. Their precise logical metric is an accepted engineering policy, not a paraphrase to silently replace with a larger or smaller one. + +Relevant accepted documents: + +- `harness/analysis-mixed-parser-proposal-20260923.md`, “Budget and parser invariants”: one complete-parse Budget; original bytes/raw tokens charged once; ordinary declaration/field/value/list storage bounded separately from final model records; aggregate metadata; no rescanning/reset. Its review §3 explicitly calls lowering/index functions noncharging phase checks and distinguishes syntax versus model counts. +- `harness/analysis-mixed-project-contract-20260923.md` §3: checked aggregate live auxiliary triples, moves transfer reservations, copies coexist, borrowed text zero copied bytes, logical slots **not allocator capacity or heap/RSS**. Explicitly excludes ordinary serde/model allocation preadmission and architectural validator/raw Issue allocation. Retained mapped diagnostic data must become charged. +- `harness/analysis-mixed-index-contract-20260924.md`, “Live storage and failure policy”: preserve previous domain; inventory the specific new maps/path/work structures; no raw model/validator/RSS claim. +- `harness/analysis-ordinary-index-contract-20260924.md`, “Storage and depth”: retained increment `1+D+A`, scratch reverse globals/typed physical keys/live work, no new frame interpretation or recharging parse/Exact work. +- `harness/analysis-mixed-rename-plan-contract-20260924.md`, “Storage and combined sizing” and “Mandatory successor”: two plan maps `R+M`, E equality scratch, output F map entries and owned bytes/path keys/entry, exact inherited per-snapshot policy and explicit old-owner transition; surviving output baseline participates in verification. It does not repeal prior heap exclusions. + +The last document deliberately requires an aggregate surviving-storage boundary. A fresh parser/resolver pass independently fitting the same numeric cap is insufficient when output or old auxiliary state remains live. It does not require cumulative input+output parse-work counters: exact policy is reused for each deliberate snapshot, while each snapshot reports its own work Usage. + +## Existing dimensions and scope + +| Quantity | Actual meaning | Evidence | +| --- | --- | --- | +| `Budget::usage.bytes/tokens/entries/references` | Cumulative work/grammar counters for one snapshot; bytes once per scanned file, every raw token including discarded trivia, declared syntax entry events, typed/active ordinary references. Not live memory. | `analysis_source/budget.rs:6–14,27–35,84–125`; `lex.rs:19–45`; `mixed.rs:94–97`; `project.rs:403–434`. | +| Exact numeric work / deepest frame | Separate measured numeric operations and maximum grammar depth. Neither is auxiliary slots nor heap bytes. | `budget.rs:127–141`; `syntax.rs:46,150,223`; typed/ordinary existing grammar policies. | +| Auxiliary entries | Logical syntax metadata + syntax-entry baseline, catalogs/projections/locations, coordination, raw expression sites, charged maps/sets/vectors/path nodes and bounded work frontiers. | `mixed/project/accounting.rs:1–70,233–249`; `project.rs:437–543`; accepted contracts above. | +| Auxiliary occurrences | Lowered occurrence records; budget ceiling entries+references. Later index/ordinary/edit maps are **entries**, not another occurrence charge. | `budget.rs:160–166`; `accounting.rs:94–103`; `project.rs:528–543`; index contract formula. | +| Auxiliary text | Separately owned in-scope strings, paths, names and retained diagnostics; borrowed original source bytes not copied auxiliary text. Output becomes separately owned carried text for the next parse. | `accounting.rs:124–128,259–352`; `project.rs:593–627`; project contract §3; rename successor contract. | +| Output complete byte limit | Sum of all final file bytes, including untouched files, checked under inherited source-byte policy. This is not itself a live-storage reservation. | `ordinary_index/rename.rs:267–308`; rename contract. | +| Static/model admission | Separate caller record/graph/step limits and static work policy. Not relabeled auxiliary entries. | `project.rs:565–583`; `mixed.rs:228–234,98–118`; project contract §3/5. | + +`Ledger::reserve` computes checked live+delta and checks all three ceilings before installing the new totals; release uses checked subtraction (`accounting.rs:6–70`). It counts logical entries rather than Rust object sizes. Vec spare capacity, BTree node layout and inline enum byte size do not add logical slots. Copying an in-scope String adds its length, not capacity; an Arc share adds its enclosing map entry but not another shared Path node. + +### Explicit exclusions, not accounting defects + +- Complete model maps/Expr/value payload allocations and ordinary serde conversion/model construction are outside preallocation auxiliary accounting (`accounting.rs:72–79`; project contract §3). Final model limits still apply. +- Architectural validation indexes and produced raw `Vec`/owned issue strings are excluded until mapping/retention. `project.rs:583–588` calls validation; thereafter reservations precede retained destination slot/path/text production. Never call raw validation preallocation bounded. +- Exact numeric internals/BigInt limb allocation are controlled by their own numeric policy, not represented as auxiliary string bytes or slots. No accepted inventory assigns every arithmetic heap object a slot. +- Allocator capacity/overhead/RSS and stack-frame bytes are not this metric. The observed environment-sensitive upstream small-stack parse limit must remain a separate empirical limitation; it is not repaired by a carried Ledger. +- Transient failure diagnostics have the documented escape needed to report resource refusal (`project.rs:160–177`). They are not silently retained in a successful witness. + +These exclusions do not excuse a new in-scope output buffer, map, copied path, planning list or retained diagnostic merely because some other allocation is excluded. + +## Parser implementation: what is checked and when + +`ParsedMixedSyntax` retains Budget, exact ProjectLimits, bundle borrow, canonical files and scalar metadata (`mixed.rs:39–58`). `parse_with_profile` creates one Budget and rejects any widening against caller-derived maximum (`:244–268`). The current checks are: + +1. Complete input file bytes checked through `index_bytes`; file count initializes metadata and is checked before `Traversal::new` (`:269–284`). Scanning later cumulatively charges bytes and raw tokens (`lex.rs:19–45`). The precheck is not another work charge. +2. Shared ordinary `State::entry` delegates grammar event charging (`mixed.rs:94–97`); typed declaration/expression parser uses the same Budget (`declarations.rs:261,290,473,539,608`; `syntax.rs:46,150,223`). Ordinary parser hooks charge its declared field/value/list/declaration events. +3. After each unit parse, metadata adds retained significant tokens, value-end map count, projected ordinary-position slots and lexical-owner count, then checks before materializing the positions (`mixed.rs:319–340`). `ordinary_position_slots` uses seven conservative declaration/header slots, field slots and walked value/container slots (`:379–400`). Dropped value-end entries can remain conservatively represented in metadata. +4. Only on resolving does `accounting::syntax` reserve `metadata + usage.entries` together, then walk retained structures to reserve their owned text and counting-work slots (`accounting.rs:233–352`). Resolver currently begins with `Ledger::default()` (`project.rs:437–442`). Catalog/lowering/index phases continue that ledger. + +Consequences that must not be obscured: + +- Existing parse checks syntax-entry usage and metadata separately; the full sum is checked by resolution. Adding a baseline only to `resolve` does not make the earlier parser checks aggregate. +- Much retained syntax text exists before the bounded accounting walk reserves it. Typed name `.to_owned()` and quoted decoding are at `cursor.rs:67–95`; ordinary AST fields/names and position key/reference clones are other producers. Calling the later accounting walk “before all syntax String allocation” would be false. +- There are actual parser temporaries not separately enumerated by the retained scalar metadata: traversal folded-path/visited/active/visit structures (`source_project/traversal.rs:9–16,59–87,97–180`), `ordinary_position_slots` counting Vec (`mixed.rs:382–396`), projection `ends` Vec and delimiter stack (`language.rs:1022–1030`). They have surrounding file/token/grammar/depth controls, but that is not a proved independent live Ledger reservation for every container. +- The position projection clones field keys and reference strings (`language.rs:1048–1090`). Those retained copies **are** included by the later syntax text walk; this distinguishes delayed accounting of in-scope retained data from unproven universal transient accounting. + +The parser proposal's general “bound temporary containers before allocation” wording is stronger than a claim that every temporary is independently represented in the current metric. The accepted Project contract concretizes the retained baseline and specific work accounting without asserting full parser heap enumeration. Parent should record any temporal/domain clarification explicitly rather than retroactively labeling every unenumerated traversal allocation either fully covered or forbidden. + +## Smallest carried-baseline design proposal + +Use a narrow private continuation carrying scalar `Slots` and exact `Limits`/ProjectLimits from a consumed owning transition. No caller-supplied reset, profile widening or arbitrary baseline fabrication. Existing ordinary entry points use zero carried slots and keep behavior. Do not add a generic allocator framework or alter model/public APIs. + +For an execution successor, let O be the live output bundle's F entries plus UTF-8 strings, copied canonical key strings and entry path. Let B be old auxiliary storage while it remains live. Reserve output against B during emission. After the documented drop of old syntax/index/plan owner, carry O into verification; if old data is retained, carry B+O instead. Model/intent borrows retain their declared exclusion, not a second hidden auxiliary baseline. + +For verification parser checks, maintain disjoint scalars: + +- C = surviving carried entries/text/occurrences, never parse-work Usage; +- U = current snapshot syntax-entry events; +- M = established parser metadata subtotal (file references, significant tokens, value-end bookkeeping/position/lexical-owner slots, with documented conservative retained overcount); +- T = current snapshot counted owned syntax text, at whichever producer/phase boundary the refined contract actually guarantees; +- W = only explicitly inventoried auxiliary scratch reservations, not an invented “all runtime allocations” proxy. + +Required aggregate checks are `C.entries + U + M + W.entries`, `C.text + T + W.text` and `C.occurrences + W.occurrences`. Checked arithmetic and inherited ceilings apply; new snapshot work counters still start at zero and are never used to debit C. Avoid charging significant tokens twice by treating token work and metadata storage as distinct counters, and avoid charging value-end conservative metadata twice when actual tables drop. + +Narrow growth seams if parent selects pre-growth aggregate guarantees: + +| Seam | Minimal responsibility / caution | +| --- | --- | +| New snapshot budget construction and grammar entry events | Preserve exact private Limits and ProjectLimits; carry C separately; entry-event checks include retained M and selected scratch. Existing numeric/byte/token work semantics unchanged. | +| Lexer retained significant-token push and file metadata | Admit counted token/file slots against C+U+M before retained growth; raw trivia work remains separate and does not allocate a retained token. | +| Mixed value-end insertion and lexical-owner push | Count newly owned logical records before growth or prove a conservative pre-reservation; release or retain documented overcount consistently. | +| Position preprojection/count walk | Add C+U to the existing projection precheck; explicitly reserve any new counting scratch. If adding bounds for existing `ends`/delimiter scratch, state the new named logical reservation rather than claim it was previously exact. | +| Counted syntax text producers | Either reserve exact decoded/copied bytes before the in-scope copy with a bounded decoder/count seam, or reserve a proven conservative whole phase bound. Raw-token spelling length is not automatically the exact decoded-string length; name/field/projection copies coexist and each counts. Do not reparse/convert Exact to estimate them. | +| Resolve handoff | Replace the internal zero start with the carried ledger. Transfer/reconcile already reserved U/M/T once; do not run old `syntax()` admission as an additive double charge. Its bounded walk can verify counts and derive LowerStorage under the same carried baseline. | +| Mapped warnings, final equality and output-owning result | Retain current diagnostic reservations; reserve verified E equality scratch against surviving storage; drop temporary syntax/model-borrowing environments at an explicit transition. Returning owned output is not returning a self-referential syntax witness. | + +An incremental **phase-check-only** carried seam is smaller: add C to each existing parser phase check and syntax reconstruction, and seed resolver with C. It preserves the old timing limitations and must be named accordingly. It is not sufficient evidence for a newly promised before-every-growth parser invariant. If that stronger temporal invariant is essential for the imminent execution contract, implement the selected counted producer hooks before calling emission/re-admission accepted; this is a bounded prerequisite, not grounds for whole-model allocator interception. + +## Acceptance and explicit decisions to revisit + +1. Parent should name the exact retained/temporary syntax charge table and temporal guarantee. Are traversal/path and projection scratch to become newly enumerated auxiliary representations now, or do their current independent file/token/depth bounds remain an explicit limitation? Either answer needs a written scope decision; do not quietly infer an all-heap requirement. +2. Does carried parsing promise aggregate before-growth on counted syntax Strings, or only at the established syntax-to-resolver phase? If the former, decoded string and projection-copy hooks are necessary; a fresh Ledger plus postparse recount cannot prove it. +3. Preserve exact prior Limits, caller ProjectLimits and snapshot provenance without exposing arbitrary profile/baseline constructors. A dedicated new-snapshot continuation should report new Usage separately, not reset or subtract the original witness's counters. +4. Test nonzero carried baselines at actual growth/phase boundaries, comparing exact cap/cap-minus-one through the real predecessor path; include output text plus copied path/entry bytes. Carry zero must preserve established behavior. Hand-count named containers, not allocator capacities. +5. Test dropped-old-owner versus simultaneous-old-owner transitions, string moves/copies and no double charge; verify no failed output/admission result escapes. Include all-file sizing and complete actual-output model equality. Do not conflate planned size with accepted bytes. +6. Keep legacy/model/raw-validator exclusions and existing stack limitations visible. Whole-RSS or full parser/model allocation containment would be a distinct future requirement with its own design, evidence and cost; it is not automatically the next smallest editing dependency. + +No stronger guarantee is proven by this audit. The recommended decision is to carry the declared logical domain faithfully, strengthen only the named parser timing gaps needed by the successor, and document remaining exclusions and phase limits rather than alternate between zero-baseline acceptance and universal heap accounting. diff --git a/harness/analysis-mixed-rename-execution-20260924/ENVELOPE-LITERAL-COUNTS.json b/harness/analysis-mixed-rename-execution-20260924/ENVELOPE-LITERAL-COUNTS.json new file mode 100644 index 00000000..bea28ab7 --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/ENVELOPE-LITERAL-COUNTS.json @@ -0,0 +1,189 @@ +{ + "scope": "Literal lexical counts, not parser admission or allocation measurement.", + "shapes": { + "tiny": { + "files": [ + { + "file": "main.arcadia", + "bytes": 78, + "significant_tokens": 10, + "max_delimiter_depth": 1, + "string_tokens": 2, + "max_quoted_token_bytes": 38 + } + ], + "total_bytes": 78, + "total_tokens": 10, + "max_file_tokens": 10, + "output_path_bytes": 24 + }, + "rich_oa": { + "files": [ + { + "file": "a.arcadia", + "bytes": 213, + "significant_tokens": 31, + "max_delimiter_depth": 1, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + }, + { + "file": "b.arcadia", + "bytes": 213, + "significant_tokens": 31, + "max_delimiter_depth": 1, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + }, + { + "file": "main.arcadia", + "bytes": 474, + "significant_tokens": 93, + "max_delimiter_depth": 4, + "string_tokens": 11, + "max_quoted_token_bytes": 38 + } + ], + "total_bytes": 900, + "total_tokens": 155, + "max_file_tokens": 93, + "output_path_bytes": 42 + }, + "rich_sa": { + "files": [ + { + "file": "a.arcadia", + "bytes": 213, + "significant_tokens": 31, + "max_delimiter_depth": 1, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + }, + { + "file": "b.arcadia", + "bytes": 213, + "significant_tokens": 31, + "max_delimiter_depth": 1, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + }, + { + "file": "main.arcadia", + "bytes": 548, + "significant_tokens": 103, + "max_delimiter_depth": 4, + "string_tokens": 13, + "max_quoted_token_bytes": 38 + } + ], + "total_bytes": 974, + "total_tokens": 165, + "max_file_tokens": 103, + "output_path_bytes": 42 + }, + "category_route64": { + "files": [ + { + "file": "main.arcadia", + "bytes": 3124, + "significant_tokens": 914, + "max_delimiter_depth": 10, + "string_tokens": 39, + "max_quoted_token_bytes": 49 + } + ], + "total_bytes": 3124, + "total_tokens": 914, + "max_file_tokens": 914, + "output_path_bytes": 24 + }, + "wide1024": { + "files": [ + { + "file": "main.arcadia", + "bytes": 3247, + "significant_tokens": 2074, + "max_delimiter_depth": 3, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + } + ], + "total_bytes": 3247, + "total_tokens": 2074, + "max_file_tokens": 2074, + "output_path_bytes": 24 + }, + "deep127": { + "files": [ + { + "file": "main.arcadia", + "bytes": 805, + "significant_tokens": 404, + "max_delimiter_depth": 129, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + } + ], + "total_bytes": 805, + "total_tokens": 404, + "max_file_tokens": 404, + "output_path_bytes": 24 + }, + "grouped127": { + "files": [ + { + "file": "main.arcadia", + "bytes": 430, + "significant_tokens": 277, + "max_delimiter_depth": 129, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + } + ], + "total_bytes": 430, + "total_tokens": 277, + "max_file_tokens": 277, + "output_path_bytes": 24 + }, + "include_paths": { + "files": [ + { + "file": "dir/left.arcadia", + "bytes": 28, + "significant_tokens": 3, + "max_delimiter_depth": 0, + "string_tokens": 1, + "max_quoted_token_bytes": 19 + }, + { + "file": "dir/right.arcadia", + "bytes": 28, + "significant_tokens": 3, + "max_delimiter_depth": 0, + "string_tokens": 1, + "max_quoted_token_bytes": 19 + }, + { + "file": "main.arcadia", + "bytes": 134, + "significant_tokens": 16, + "max_delimiter_depth": 1, + "string_tokens": 4, + "max_quoted_token_bytes": 38 + }, + { + "file": "shared.arcadia", + "bytes": 10, + "significant_tokens": 0, + "max_delimiter_depth": 0, + "string_tokens": 0, + "max_quoted_token_bytes": 0 + } + ], + "total_bytes": 200, + "total_tokens": 22, + "max_file_tokens": 16, + "output_path_bytes": 71 + } + } +} diff --git a/harness/analysis-mixed-rename-execution-20260924/EXECUTION-ENVELOPE-CRITIQUE.md b/harness/analysis-mixed-rename-execution-20260924/EXECUTION-ENVELOPE-CRITIQUE.md new file mode 100644 index 00000000..6982032d --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/EXECUTION-ENVELOPE-CRITIQUE.md @@ -0,0 +1,42 @@ +# Exploratory critique: topology-preserving verification envelope + +2026-09-24; source base `ee500908e3d77182ddd54e12524f9b6c6eb43b60` and reviewed private rename planner. Read-only investigation; no implementation or Cargo. Paths below begin at `crates/oa-core/src/`. This is not an accepted architecture or runtime cap result. + +**Conclusion:** a parser-only conservative envelope is a viable alternative to intrusive parser accounting, provided actual emitted bytes are authenticated before relying on original topology, and the envelope explicitly covers transient copies. Neither original resolved B nor B plus the source-length delta is a demonstrated bound. Prefer a small independent envelope proof/count experiment before choosing parser instrumentation; do not yet ship a guessed multiplier. + +## Topology argument and malformed output + +`model.rs:1739–1746` allows only ASCII letter/underscore followed by ASCII alphanumeric/underscore names, excluding reserved spellings. This is exactly the raw Word alphabet (`language/raw_tokens.rs:61–70`). Replacing an entire authenticated Word with another such name preserves the token's class and its boundaries against unchanged surrounding bytes. It cannot create a quote, comment marker, delimiter, whitespace or numeric token. All syntax keywords, punctuation, literals and include strings remain untouched. The original typed/ordinary maps identify name grammar positions; final simultaneous namespace validation preserves qualified identities through swaps. Consequently token count, AST/position/expression topology, nesting and the include graph remain the same; byte offsets and stored name lengths change. + +This reasoning applies to the **specified edit stream**, not arbitrary bytes produced by a buggy emitter. Before dropping the original owner, compare the actual complete output entry/path set and every file against the concatenation of original untouched slices and authorized replacement strings. Do this as a checked streaming comparison, with no second output buffer or re-lexing. Output must already have its F/content/path/entry reservations before construction. Reject a mismatch before parsing; keep the authenticated output privately owned and immutable through verification. A hash or a promise that the emitter is correct is not this guard. Without it, a malformed output could introduce arbitrarily different topology within the byte cap and invalidate an old-topology envelope before the parser refuses it. + +Actual output parsing/resolution/whole-Project equality remain mandatory after this guard. The guard preserves non-name bytes; semantic equality alone cannot. Malformed-emitter controls would intentionally stop at the guard, whereas independent parser refusal tests exercise the parser separately. + +## Concrete terms absent from a simple retained-B bound + +| Carrier | Required contribution / source | +| --- | --- | +| Retained syntax and name text | Enumerate original syntax nodes/text and translate authenticated name lengths. Ordinary Reference spellings exist in **both** Ast and projected EditKind (`language.rs:1087`); a single source-byte delta undercounts their growth. | +| Projection token ends and delimiters | `edit_positions_from_tokens` allocates `ends` with one slot per significant token and a delimiter stack (`language.rs:1023–1035`) while tokens/AST/value-end metadata already exist. Add these transient terms; they are not established by retained final index counts. | +| Projection counting walk | `mixed.rs:379–405` has an additional Vec of Ast references. Its frontier is bounded by original ordinary value count; it runs before projection. Use a phase maximum instead of automatically summing both scratch peaks. | +| Typed declaration scratch | `declarations.rs:284–300` owns parameter-name and parameter-ID sets plus a borrowed field-name set. Names are cloned separately from retained parameter Reference strings. Override target names have another set (`:604–610`). | +| Typed expression scratch | `syntax.rs:15–39,225,393–401` has task/value vectors, sequence vectors, cloned call-label duplicate-detection keys and conversion overlap. Bound suspended nested sequences by original argument/node/frame counts; E alone is not a proved multiplier for all these containers. | +| String scanning/decoding | The raw scanner validates quoted strings using a temporary decoded String (`raw_tokens.rs:127`); the parser later decodes them again (`language.rs:1194–1201`, `cursor.rs:82–95`). Unchanged literal token lengths give a conservative maximum for transient decoded text, including UUID strings not retained as strings. | +| Traversal/path work | Same include graph means actual F/include counts and paths are unchanged. Nevertheless folded keys, stack/active/visited/children and cloned target/origin paths coexist (`source_project/traversal.rs:8–17,55–92,96–191`). Path normalization also allocates component Vecs, uppercase component strings and joined paths (`source_project.rs:120–164`). Count these explicitly. Unicode lowercase expansion must be measured/bounded, not assumed byte-neutral. | +| Collection transitions | Parsed canonical BTreeMap to file Vec (`mixed.rs:374`) and sequence collection conversions require an explicit logical-live overlap rule. No allocator-capacity/RSS claim follows from logical slots. | + +These terms are finite and source-derived. Include scratch can be bounded using actual authored include-edge count plus F and maximum/path-sum lengths, rather than default maximum limits. Name growth needs role-weighted copy counts or a separately proved conservative maximum multiplicity; several carriers demonstrably require **two** simultaneous copies. No complete universal multiplicity was proved in this bounded investigation. + +An ordinary-heavy route/array fixture is particularly important: significant token count can grow substantially while retained name/index additions remain small. The projection's extra token-end vector therefore cannot be justified merely by pointing to later name/index headroom. This rejects the proposed *inference* B≥earlier parser peak; it is not a claim that a particular measured fixture exceeded B. A formal phase accounting or measurement-backed bound is still needed. + +## Minimal compatible use and comparison + +Use this envelope only for parsing first. After the authenticated old owner drops, reserve **O+Vparse**, where O is all owned output slots/text and Vparse is the proved parser peak under transformed name lengths. Parse under the exact inherited per-snapshot Limits/ProjectLimits. Then transfer the admitted retained syntax subtotal into the existing resolver with carried O, releasing only the envelope excess. The resolver still needs its narrow baseline seam; final whole-Project equality still needs E. Do not reserve Vparse forever alongside the resolver's own syntax reservation or silently forget O at handoff. + +| Choice | Useful caps / proof / maintenance | +| --- | --- | +| Topology envelope + exact-byte guard | Avoids pervasive parser edits and preserves existing parse semantics. Can use actual original shape and phase maxima, so potentially useful under normal profiles. Conservative copies can reject tight profiles. Duplicates an inventory of parser allocations and must change whenever those sites change. | +| Carried-ledger parser path | Charges actual live phases and can admit cases rejected by a loose envelope. Broader implementation/testing surface, especially shared parser/traversal seams. Allocation changes remain closer to their checks, reducing long-term proof drift. | +| Reserve hard limits or an unexplained B/byte multiple | Reject: hard-limit reservation plus nonempty output often leaves no admissible headroom; unexplained multipliers have no safety proof. | + +**Next discriminating step:** independently enumerate Vparse entries/text for a tiny project, rich OA/SA, ordinary-heavy64-route-point category, wide/deep typed expressions, nested calls, long renamed parameters and include-heavy paths. Count copy multiplicities and phase overlap from source, including the guard's own zero-container walk. Demonstrate a realistic inherited cap that passes emission and O+Vparse, plus cap-minus-one refusal before parsing; compare with a tighter actual-live estimate to quantify false rejection. No such executable acceptance experiment was run here. If the count walker becomes a second parser lifecycle implementation or rejects ordinary useful cases, choose carried-ledger instrumentation instead. diff --git a/harness/analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-ENVELOPE-FEASIBILITY.md b/harness/analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-ENVELOPE-FEASIBILITY.md new file mode 100644 index 00000000..71ab5f5e --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-ENVELOPE-FEASIBILITY.md @@ -0,0 +1,74 @@ +# Rename verification envelope: bounded feasibility result + +2026-09-24. Source-only investigation of private parser base `ee500908e3d77182ddd54e12524f9b6c6eb43b60`; no production edits, Cargo or parser execution. Current rename-plan acceptance is separate. + +**Decision: stop the envelope candidate and recommend the carried-ledger parser path.** A topology-specific envelope is mathematically possible, but no complete safe Vparse entries/text formula or useful aggregate cap has been established here. Closing the remaining terms requires a parallel model of nearly every parser allocation lifecycle. This meets the requested stop criterion; the partial bounds below must not be used as a verification admission gate. + +The reason is proof and maintenance cost, not a claim that every conservative envelope would fail ordinary default-profile examples. The supplied small literals could plausibly fit generous caps. That observation is not an aggregate storage proof or a measured admission result. + +## Valid precondition retained + +The exact-byte guard remains sound: before old-owner drop, compare complete output paths/entry and each actual file against the original untouched slices plus validated replacement names. Use a streaming comparison without another output buffer. Count and reserve all output content/path/entry bytes and F map slots before construction. Keep verified output privately immutable until parsing. + +Only under that guard do whole ASCII/nonreserved Word replacements preserve token classes/count, AST topology, include graph, expression structure, literals and depth (`model.rs:1739–1746`, `language/raw_tokens.rs:61–70`). Arbitrary malformed emitter output must fail the guard **before** the old-topology bound is applied. Parsing/admission/normal full-Project equality are still required afterward. A checksum or independently supplied output bundle is not this guard. + +## Explicit bounds established, and their limits + +Use checked arithmetic. Let T be significant-token count for one currently parsed file, E its typed expression-node count, A its ordinary AST value count, F complete file count, and K actual authored include edges. Retained original syntax/tokens can supply these counts without parsing new bytes. For tighter typed bounds, use tokens in a retained root's full original span instead of whole-file T. + +1. **Projection:** token-end Vec has exactly T entries; its delimiter stack has at most T entries (`language.rs:1023–1035`). Thus **Vprojection_scratch.entries ≤2T** is explicit and safe for these two containers. A tighter term is T+maximum unmatched brace/bracket depth. New position records themselves must already be included in the retained-syntax allowance. The preceding `ordinary_position_slots` walk has at most A pending borrowed values (`mixed.rs:379–405`); use **max(A,2T)** for these nonoverlapping scratch walks, not A+2T. +2. **Pratt task Vec:** for one binding, let X be Expression tasks, B binary-continuation expansions and N sequence-child collections. Expression pushes at most3 tasks; a binary continuation pushes3; Next/Collected together push3 per child. Each Expression consumes a distinct starting token, each binary expansion a distinct operator token, and N≤X. Total pushes are at most **1+3X+3B+3N ≤1+6T** (`syntax.rs:38–295`). Live task entries cannot exceed total pushes. This is a proved coarse bound for **that Vec only**. It is not a bound for sequence/value vectors, call-name sets, retained expressions, literal metadata or text. +3. **Copied reference growth:** an ordinary Reference owns its spelling in both Ast and projected EditKind (`language.rs:1338–1341,1087`). If that alias grows by d bytes, these two retained copies grow by **2d**, although emitted source grows by d. Parameter-name, override-target and call-label duplicate sets own additional copies (`declarations.rs:293,610`; `syntax.rs:225`). A single unweighted source-length delta is therefore unsound. Full text accounting needs explicit per-role copy multiplicity, including simultaneous temporary names. +4. **Output:** independently of Vparse, exact output reservation is **O.entries=F**, **O.text=C+P**, where C is all final source-content bytes and P is entry-path bytes plus every file-key's bytes. None may disappear when the old witness drops. + +Original resolved/indexed B can upper-bound its own retained syntax subtotal, but does not prove these extra earlier scratch peaks. In particular, projection token ends coexist with retained tokens/AST, and may dominate ordinary-only examples having few name records. No experiment here establishes B≥parser peak. + +## Concrete literal comparisons + +[envelope_literal_counts.py](envelope_literal_counts.py) and [ENVELOPE-LITERAL-COUNTS.json](ENVELOPE-LITERAL-COUNTS.json) perform independent literal lexical counts only. They do not import/run the application lexer/parser, inspect produced syntax, or measure allocation. The scanner recognizes all bytes in these specific fixtures. Rich literals reproduce the accepted fixture's900/974 bytes; expanded category is the corrected SHA39435798…15fc literal plus64 route points,3,124 bytes. Wide/deep literals use the accepted lowerer-test constructions (`lower/tests.rs:846–858`); their new complete bundle wrappers were not run. Parentheses-only and include-path examples are exploratory literals. + +| Shape | F | Content C | Significant tokens total / largest file | Derived E | Output C+P before length-changing renames | +| --- | ---: | ---: | ---: | ---: | ---: | +| Empty project | 1 | 78 | 10 / 10 | 0 | 102 | +| Rich OA, including nested calls | 3 | 900 | 155 / 93 | 15 | 942 | +| Rich SA | 3 | 974 | 165 / 103 | 15 | 1,016 | +| Category plus64 route points | 1 | 3,124 | 914 / 914 | 0 | 3,148 | +| One1,024-item typed list | 1 | 3,247 | 2,074 / 2,074 | 1,025 | 3,271 | +|127 nested abs calls | 1 | 805 | 404 / 404 | 128 | 829 | +|127 redundant parenthesis groups | 1 | 430 | 277 / 277 | 1 | 454 | +| Four-file diamond include graph | 4 | 200 | 22 / 16 | 0 | 271 | + +E here is source-derived expression shape, not new runtime output. Token totals exclude trivia; they are not Budget's raw-token Usage (which charges trivia too). The include example has4 authored edges and two occurrences of `../shared.arcadia`; path copies are71 bytes for output alone, despite only200 content bytes. + +These discriminate the candidate: + +- Grouping changes Pratt control work without adding semantic Expr nodes; E-only parser scratch is insufficient. Retained token spans/counts are needed. +- Route64 has no typed expressions but still914 token ends plus the projection stack. Name-map headroom cannot stand in for this term. +- Whole-file `1+6T` allows12,445 task entries for the wide list, although sequential list items have a small actual task frontier. Using per-root T removes surrounding declaration tokens but not the fundamental width/peak mismatch. Recovering a useful tight bound requires matching Pratt scheduling, suspended sequences and expression shape. +- Rich OA's nested calls keep outer sequence argument values/key sets while the inner call is parsed; charging only the largest individual call's labels is insufficient. Include normalization and traversal work are independent again. + +No total cap or cap-minus-one claim follows from these partial figures. In particular, adding known O and a partial scratch term does not establish a cap that admits all parser/resolve predecessors. + +## Why the remaining formula mirrors the parser + +A nominal phase formula would be: + +`Vparse = max(folded-path setup, retained-syntax-prefix + traversal-live + current-file phase scratch, final file-table transition)` + +with separate entries/text maxima. This is a **template with unproved terms**, not an explicit safe bound. Filling those terms requires all of the following: + +- Pratt tasks plus the outer values Vec, every suspended Sequence.values and owned key set, and collection transitions (`syntax.rs:15–29,239–255,393–401`). The 6T task proof does not cover them. +- Declaration field-name/parameter-name/parameter-ID sets and case override sets, including which coexist with which expression work (`declarations.rs:284–325,604–629`). +- Ordinary open-declaration indices, recursive field-key locals and clone/move boundaries (`language.rs:1238–1269,1469–1528`). +- Numeric literal token Vecs retained outside semantic E nodes (`analysis_source.rs:45–58`, `cursor.rs:112–121,164–168`) and transient normalized ratio text (`cursor.rs:152–160`). These were additional carriers found during the attempted closure; excluding exact-number heap does not automatically exclude their auxiliary Vec/String allocations. +- Quoted-string scanner validation, parser decoding/UUID temporaries and projected reference/key copies; a single final decoded-text sum does not specify the transient maxima. +- Traversal folded-key creation, stack/children transfer, active/visited/current paths and origin copies, plus `resolve_include` component Vec, uppercase component checks and joined path (`traversal.rs:55–191`; `source_project.rs:120–164`). Unchanged graph bounds them but does not supply copy counts automatically. Unicode folded path lengths also need a real bound. +- Parsed BTreeMap→Vec and other transition overlap, rejection/cleanup policy, and a clear choice of which logical slots are already represented by existing syntax-entry/metadata counters rather than counted again. + +A counter walker must therefore mirror the parser's declaration variants, ordinary AST/projection shape, typed scheduling, literal forms and shared traversal implementation. Broad summed totals avoid scheduling simulation only by sacrificing the phase precision that makes tight admission useful. A complete trusted formula would also need revision when any of these internal copies changes, although the language and rename topology stay identical. + +## Recommendation + +Select the **private carried-ledger parser increment**, keeping the exact byte guard as useful emitter verification rather than as authority for an incomplete memory envelope. Put checks at the growth/transition sites and transfer authenticated retained reservations to the resolver; preserve existing exact per-snapshot Limits/ProjectLimits, work counters and model/serde exclusion policy. Do not make a global parser rewrite or public source8 change part of that increment. + +This still requires a bounded carrier inventory, but keeps each reservation/release beside the operation it governs and measures actual live phases. It avoids shipping and maintaining a second parser lifecycle description plus looser false refusals. If a future profiled workload motivates an envelope, reopen it with a complete independently checked formula and useful cap evidence, not the partial inequalities in this report. diff --git a/harness/analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-SOURCE-MAP.md b/harness/analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-SOURCE-MAP.md new file mode 100644 index 00000000..222635a5 --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/RENAME-EXECUTION-SOURCE-MAP.md @@ -0,0 +1,76 @@ +# Mixed rename execution: minimal source seams and hazards + +2026-09-24. Investigation only, against private base **`ee500908e3d77182ddd54e12524f9b6c6eb43b60`** and the reviewed working rename planner. No implementation, Cargo, commits or Gitea actions. Current planning acceptance remains primary. Paths below begin at `crates/oa-core/src/`. + +**Recommended direction:** consume the verified plan; validate the complete current snapshot; emit one owned complete bundle under the existing aggregate ledger; explicitly drop the old auxiliary owner; verify the output with the exact inherited per-snapshot policy and the surviving output reservation; return an owning bundle/model result after temporary verification syntax drops. Reuse parsing, resolution, validation and model equality. Do not reuse the public updater or add a second general edit framework. + +There is **no carried-baseline parser/resolver API today**. Adding a baseline only to `resolve` would not satisfy the successor contract: output already coexists with parser allocations before resolution begins. This is the principal unresolved implementation seam. + +## Reusable pieces and necessary narrow changes + +| Actual seam | Reuse / required change | +| --- | --- | +| `ordinary_index/rename.rs:6–13,163–174,259–315` | Plan owns the complete old witness, external desired borrow and two authenticated maps. Reuse its exact current-bundle check and combined sizing. Execution must consume this authority, not take independently supplied edits or a Budget. Line refs identify the reviewed draft; future formatting may move them. | +| `analysis_source/update.rs:195–219` | Useful copying algorithm: walk original sorted ranges, append untouched slices and replacement names, append tail. Do not directly adopt its numeric-file result, extra length map or independent Budget argument. | +| `source_project.rs:19–23,52–59` | Output owns `entry: String` and `BTreeMap`; ProjectLimits includes file, include-depth, include-edge and model limits. All must survive; source-byte limit alone is insufficient policy. | +| `analysis_source/budget.rs:6–14,36–64` | Limits is Copy but private inside Budget. Add only a private read-only exact-profile extraction seam. A deliberate new snapshot gets a new Budget with those Limits; never zero or replace counters inside a still-live old witness. | +| `analysis_source/mixed.rs:38–47,244–268` | ParsedMixedSyntax retains ProjectLimits, Budget, canonical files and metadata. `parse_with_profile` preserves an explicit profile but currently constructs a fresh independent Budget; `parse` reconstructs defaults and must not be used for tightened-policy continuation. | +| `mixed/project.rs:438–443` | Resolver currently starts `Ledger::default()` then accounts syntax. A new private entry point must receive the parser's authenticated surviving reservation/baseline rather than fabricate another independent ledger. Keep the old wrapper behavior for existing callers. | +| `mixed/project/accounting.rs:234–369` | Reuse syntax traversal/lowering-count logic, but specify one owner for syntax entry/text reservations. If the new parser already reserved them, this routine must not charge the same retained storage again; its live walk slots and later lowering scratch still count. | +| `mixed/project.rs:595–644` | Actual validation transfers owned warnings after reservation and records actual static admission limits/usage. A narrow consuming extraction may move Project/warnings/metadata out and drop syntax/raw sites. Do not clone the desired Project or return old warnings as if output were re-admitted. | + +## Output storage and original-coordinate emission + +Let **L** be the planner's current live ledger (already old B plus R+M). Let **F** be complete file count, **C** the checked sum of final source-content bytes, and **P = entry.len + sum(path.len)** for copied output path strings. The new owned output requires at least: + +`O = Slots { entries: F, occurrences: 0, text: C + P }`. + +The owning SourceBundle struct itself is inline; entry text still counts even though the same path spelling also exists as a map key. Unchanged files are copied and counted. Reserve the whole checked O before constructing any output String/path/map entry, keeping L live. A per-file reservation can also be sound but adds more interleavings to verify. A currently built String can belong to its already reserved destination slot; document this rather than charging it inconsistently twice. + +Repeat the streaming per-file sizing walk if necessary; no F-entry length table is required. Use the validated sorted original physical keys. Copy original slices and borrowed replacement names directly, without formatting, rescanning references or applying one name swap after another. Full Word spans preserve @/$, comments, whitespace, historical content and all non-name bytes. Allocation capacity is not the logical text metric, and `with_capacity` is not itself a budget check. + +Keep separate checks for final content C under the inherited complete source-byte policy and **live auxiliary text L.text+C+P** under the ledger. Passing the former does not imply the latter. Conversely, parsed Usage.bytes is a work/input measure: do not add it as another owned source-buffer copy when O already accounts that buffer. Existing caller-owned old source and desired Project remain external borrowed memory under the established logical policy; this is not an RSS bound. + +The immediate emission peak is **L+O**. After emission succeeds, save only required policy/metrics/E scalars and the desired borrow, drop old syntax/index/maps/names/edits, and only then release their reservations. Carry O forward as live storage. A fresh ledger that forgets O is incorrect even after all old auxiliary state is dropped. A private consumed handoff can move the ledger and release its known old subtotal; it should not expose a public factory accepting arbitrary caller-reported baseline Slots. + +## Why parser accounting is the consequential seam + +Current mixed parsing has an intentionally staged policy: + +- `lex.rs:20–55` charges source bytes/raw tokens, then allocates retained significant tokens. Token Usage is separate from auxiliary entries. +- `mixed.rs:96–97,277–283` charges ordinary syntax entries and checks initial file metadata independently. +- Each whole file is lexed and parsed before `metadata` adds its tokens, value-end map, projected positions and lexical owners (`mixed.rs:297–330`). +- `ordinary_position_slots` allocates its own traversal Vec before the projection reservation (`mixed.rs:379–405`); canonical BTreeMap→Vec conversion occurs at `:374`. +- Shared Traversal owns folded-path validation strings, stack/active/visited/children containers and cloned paths/locations (`source_project/traversal.rs:8–17,55–92,96–191`), bounded through its existing ProjectLimits policy rather than the mixed Ledger. +- Only later does `accounting::syntax` reserve **metadata+Usage.entries**, traverse decoded owned text and reserve its own work slots (`accounting.rs:109–118,234–280`), after resolver has started a new ledger. + +Thus passing O only into `resolve` checks too late, and independently reducing a local metadata ceiling is not a complete proof: syntax entries, retained metadata, owned decoded text and parser scratch coexist. The narrow successor work must identify the parser's authoritative live subtotal, check **O plus that subtotal before relevant allocation**, and transfer that subtotal into the resolver without charging it twice. Work counters and auxiliary reservations need distinct handling; merely subtracting O from the Limits object would silently alter the per-snapshot policy and conflate domains. + +Two compatible candidates merit consideration: + +1. **Private carried-ledger parsing path:** thread a private accounting context through existing mixed parser growth seams, retain its ledger in the syntax witness, and reuse resolver accounting with an explicit already-reserved-syntax handoff. Reuse actual lexer/parser/project semantics; do not create a second parser. This is the clearest proof but touches more than an emitter wrapper. Inventory token/AST/position text, temporary work and file-table transition overlap once. +2. **Conservative verification envelope reserved before parsing:** potentially fewer parser changes, but only sound with a proved envelope for every parser/resolver temporary and text copy under the output/profile. The existing original metadata/E counts alone do not bound decoded-text copies, Traversal scratch or corrupted-output shapes. Reserving the whole current hard limit in every domain would frequently make any nonempty O impossible. Do not claim this shortcut is available without an independent bound and useful-cap evidence. + +Prefer candidate1 unless candidate2 receives a concrete source-derived proof. The contract must explicitly state treatment of existing Traversal/projection/conversion scratch; adding new copied paths or a new temporary container cannot disappear behind an old exclusion. This is a bounded accounting decision at real allocation sites, not a request to redesign parsing or retroactively claim every existing caller had an aggregate parser ledger. + +## Actual output admission and final equality + +Use the exact inherited Limits **and** ProjectLimits for the deliberate new parse. Original parse Usage/numeric units are historical metrics; output has separate measured counters. Preserve static admission policy and use the existing complete `validation::validate_with_usage` result, not a name-only check. The consumed-old-owner transition avoids needing two full syntax/index owners simultaneously; O remains live throughout new parsing, lowering, warnings and comparison. + +No new typed or ordinary index is required merely to accept output: resolve/admit actual bytes, then compare the **entire Project with normal `PartialEq`**, including the renamed aliases/parameter names. Do **not** call the planner's `same_project`, which deliberately exempts those fields and would accept an admissible but incompletely renamed output. + +Retain original E as a checked scalar before dropping the old witness. The plan already proved desired expression shapes equal to original; the intended target supplies the same frontier bound even when actual output is wrong. Reserve E against the new live verification ledger before full Project equality, release after its vectors drop. This is an additional comparison phase, not a reason to retain old raw arenas. Existing all-carrier signed-zero equality applies; non-name source-byte preservation comes from exact copying and byte oracles, not from semantic equality alone. + +Malformed output must fail parsing/resolution; admissible-but-wrong aliases or another payload must fail whole-target equality. Failure returns only located diagnostics and destroys output/verification state. Do not debug-format arbitrary target expressions or adopt history/save before success. + +## Owning result without self-reference + +A temporary inner verification scope can borrow the newly owned SourceBundle, resolve it, compare it, and then consume the resolved owner into owned Project, warnings and copied policy/usage metadata. Drop temporary syntax/raw arenas before moving SourceBundle into an owning accepted result. None of the moved fields borrow output strings, so this requires no self-referential wrapper, Pin or unsafe code. Actual warnings contain owned paths/messages (`project.rs:603–620`). Preserve their reservations until the corresponding result fields move/drop; do not release still-retained warning strings as though all resolver auxiliary storage vanished. + +This result should make no reusable-index claim. A future edit would parse/index again unless a separately justified caller-owned-output borrowing API is chosen. Reusing public CompiledSourceProject (`source_project.rs:111–117`) would misleadingly require its different SourceIndex/stabilization conventions; prefer a narrow private accepted result with the capability actually established. + +An explicit unchanged execution outcome can return the original AuthoredMixedProject after the full current-snapshot check, without output copies or new parsing. A changed outcome can own the new bundle/model/warnings. No-op planning may already have needed E headroom; no-op execution does not retroactively waive that check. + +## Discriminating next evidence + +Before implementation acceptance, require independent exact complete output bytes for mixed/scoped swaps and comments/Unicode, including growing and shrinking edits whose combined total fits; unchanged files must be included. Tighten bytes/entries/numeric/frame and ProjectLimits independently to prove exact policy retention. Isolate L+O, O+parser storage, O+resolver scratch/warnings, and O+resolved+E boundaries with successful predecessors. Include malformed output, valid-but-wrong name output, stale untouched-file/entry/path changes, late failure/drop and no-op unchanged ownership. The current planner tests do not establish these execution guarantees. diff --git a/harness/analysis-mixed-rename-execution-20260924/envelope_literal_counts.py b/harness/analysis-mixed-rename-execution-20260924/envelope_literal_counts.py new file mode 100644 index 00000000..5ae671f3 --- /dev/null +++ b/harness/analysis-mixed-rename-execution-20260924/envelope_literal_counts.py @@ -0,0 +1,47 @@ +"""Independent literal counts only; does not import/run any application parser.""" +from pathlib import Path +import json, re, hashlib +root=Path(__file__).resolve().parents[2] +out=Path(__file__).parent +def uid(n): return f'00000000-0000-0000-0000-{n:012}' +def doc(body): return f'arcadia 8;\nproject p "Project" id "{uid(1)}" {{\n{body}\n}}\n' +def rich(sa): + prop,work=('sa_property','sa_function') if sa else ('oa_property','oa_activity') + diagram='layer Sa;' if sa else '' + extra=f'sa_system s "System" id "{uid(6)}" {{}}' if sa else '' + main=doc(f'include "b.arcadia"; include "a.arcadia";\nnode n id "{uid(4)}" {{ diagram @d; element @v; }}\n{prop} v "Value" id "{uid(3)}" {{ subject @w; type Number; base @f(y: 2, x: @g(x: 3, y: 4)) + @f(x: 5, y: 6); }}\n{work} w "Work" id "{uid(2)}" {{}}\ndiagram d "Diagram" id "{uid(5)}" {{ {diagram} }}\n{extra}') + files={'main.arcadia':main} + for file,alias,name,n,op in [('a.arcadia','f','F',10,'+'),('b.arcadia','g','G',11,'-')]: + files[file]=f'calculation {alias} "{name}" id "{uid(n)}" {{\ninput x id "{uid(1)}" : Number;\ninput y id "{uid(12)}" : Number;\nresult Number; body $x {op} $y;\n}}\n' + assert len(main.encode())==(548 if sa else 474) + assert len(files['a.arcadia'].encode())==len(files['b.arcadia'].encode())==213 + return files +pattern=re.compile(rb'(?P[ \t\r\n]+)|(?P//[^\n]*)|(?P"(?:[^"\\]|\\.)*")|(?P[A-Za-z_][A-Za-z_0-9]*)|(?P[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?)|(?P[<>!=]=)|(?P[{}();,\[\]:=@$+*/<>!\-])') +def count(files): + result=[] + for path,text in sorted(files.items()): + raw=text if isinstance(text,bytes) else text.encode() + cursor=0; significant=0; depth=0; peak=0; strings=0; stringmax=0 + for m in pattern.finditer(raw): + assert m.start()==cursor,(path,cursor) + cursor=m.end() + if m.lastgroup in ('space','comment'): continue + significant+=1 + if m.lastgroup=='string': strings+=1; stringmax=max(stringmax,len(m[0])) + if m[0] in (b'{',b'[',b'('): depth+=1; peak=max(peak,depth) + if m[0] in (b'}',b']',b')'): depth-=1; assert depth>=0 + assert cursor==len(raw) and depth==0 + result.append({'file':path,'bytes':len(raw),'significant_tokens':significant,'max_delimiter_depth':peak,'string_tokens':strings,'max_quoted_token_bytes':stringmax}) + return {'files':result,'total_bytes':sum(x['bytes'] for x in result),'total_tokens':sum(x['significant_tokens'] for x in result),'max_file_tokens':max(x['significant_tokens'] for x in result),'output_path_bytes':len('main.arcadia')+sum(len(p.encode()) for p in files)} +category=(root/'.local/as3batch/crates/oa-core/src/language/analysis_source/mixed/project/ordinary_index/tests/fixtures/categories.arcadia').read_bytes() +assert hashlib.sha256(category).hexdigest()=='3943579866157c7b5d95ce9edcb2d643058826b9af44257557e2864f130d15fc' +route64=category.replace(b'routes [{ edge @link; }];',b'routes [{ edge @link; waypoints ['+b', '.join([b'{ x 0; y 0; }']*64)+b']; }];') +assert len(route64)==3124 +shapes={'tiny':{'main.arcadia':doc('')},'rich_oa':rich(False),'rich_sa':rich(True),'category_route64':{'main.arcadia':route64}} +shapes['wide1024']={'main.arcadia':doc(f'calculation wide "Wide" id "{uid(82)}" {{ result List(Number); body ['+', '.join(['1']*1024)+']; }')} +shapes['deep127']={'main.arcadia':doc(f'calculation deep "Deep" id "{uid(81)}" {{ result Number; body '+'abs('*127+'1'+')'*127+'; }')} +shapes['grouped127']={'main.arcadia':doc(f'calculation grouped "Grouped" id "{uid(81)}" {{ result Number; body '+'('*127+'1'+')'*127+'; }')} +shapes['include_paths']={'main.arcadia':doc('include "dir/left.arcadia"; include "dir/right.arcadia";'),'dir/left.arcadia':'include "../shared.arcadia";','dir/right.arcadia':'include "../shared.arcadia";','shared.arcadia':'// shared\n'} +results={k:count(v) for k,v in shapes.items()} +(out/'ENVELOPE-LITERAL-COUNTS.json').write_text(json.dumps({'scope':'Literal lexical counts, not parser admission or allocation measurement.','shapes':results},indent=2)+'\n') +print(json.dumps({k:{x:v[x] for x in ['total_bytes','total_tokens','max_file_tokens','output_path_bytes']} for k,v in results.items()},indent=2)) diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/.gitattributes b/harness/experiments/analysis-mixed-rename-plan-20260924/.gitattributes new file mode 100644 index 00000000..2070f9ee --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/.gitattributes @@ -0,0 +1,4 @@ +*.md -text +*.py -text +*.txt -text +*.json -text diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/PACKAGE-READBACK.md b/harness/experiments/analysis-mixed-rename-plan-20260924/PACKAGE-READBACK.md new file mode 100644 index 00000000..e67d00ca --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/PACKAGE-READBACK.md @@ -0,0 +1,17 @@ +# Independent package readback + +**PASS for preservation and reported evidence scope.** Reviewed 2026-09-24 against source `18073a6f2eabce83fc83997f094e331eec835a16`. The private worktree still names that commit and has no tracked modifications. This is a package audit, not a new application execution or broader product acceptance. + +The unchanged `evidence.zip` has **76 unique members, 584,235 bytes**, SHA256 `1c041d181540b474e14e80677cfe287d305951eaee48e492de7f59dcdea2391c`. All CRCs pass; every member name, byte count and SHA256 matches `manifest.json`. All 74 file members equal their original local evidence bytes; both patch members equal newly read immutable Git diffs. All nine readable mirrors equal their archive members. The critique navigation page is a separate addition, not a tenth mirror. All 11 local Markdown links in the reviewed documentation resolve, including source review → navigation page → authoritative critique. + +Independent raw-log reconciliation confirms **17 focused passes**, **246 listed names**, and **230 passed / 16 failed** in the full library. All 229 baseline outcomes remain unchanged; all 16 complete failure bodies match after normalizing only numeric thread identifiers. Strict all-target Clippy exits 0. Formatting exits 1 with eight inherited diff blocks and byte-identical baseline log SHA256 `c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d`. + +All final receipts pin the stated source and the same 551 declared inputs, independently compared with immutable Git blobs and current raw files. Included log/input/launcher hashes reconcile, as do current artifact bytes: 42,081,792 bytes, SHA256 `2c8bd7b9a6adfda3f74b74bae00453b1b1348cbed47f04c8e8c1de9152899416`. This does not authenticate unrecorded build environment or independently reverify remote publication. + +The archive preserves all three initial focused stack-overflow aborts, both marker aborts, the original artifact's 16-pass filtered run (230 tests filtered out), both prologue observations and all three debugger runs. The debugger logs include both a pass and the overflow trace through exact-number parsing. These records support the README's deliberately limited diagnosis, not a precise explanation of environmental variation. The final scoped planner test passes; the earlier full-pipeline 128 KiB setup failure remains unresolved. No passing debugger process status is substituted for a test result. + +No material README overclaim found. Its claims remain private rename planning and scoped verification; output emission/readmission, public source8, published preview integration, Linux/WSL and broader stack guarantees are explicitly excluded. The old source review's pending-runtime language is preserved as historical evidence and linked to the later runtime review. Toolchain text is identified as a reused record. + +Reviewed README SHA256: `c952171bb1e23e11bcaaa6fbed340a074aa5c5d4992319f17f3f76f0ac263faa`. Manifest SHA256: `3f3f9bbb971b8358788cafcbe1b9d5ca2264850eea9fc5406f3b4d1e7206e074`. + +Local reproducible inspection: `.local/analysis-mixed-index-seam-20260924/inspect_rename_package.py`, SHA256 `3ff55c37fbf63334efa185c5d188c4ecf9479e5e85398d7c25d6a25f02515e08`; result `RENAME-PACKAGE-READBACK.json`, SHA256 `9c41ec76b023ca1dffb8fd96c94199b32d7d6f1e8dfeb68521123a941352ebec`. The checker only reads ZIP/local/Git data and writes its local readback. No archived code, Cargo, application executable, network operation or production edit was used. This report is outside the immutable archive. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/README.md b/harness/experiments/analysis-mixed-rename-plan-20260924/README.md new file mode 100644 index 00000000..24ad87da --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/README.md @@ -0,0 +1,79 @@ +# Private complete-target mixed rename planning + +Source **18073a6f2eabce83fc83997f094e331eec835a16**, pushed and ref-verified on +`codex/analysis-mixed-rename-plan-956atf-20260924`. The +[accepted contract](../../analysis-mixed-rename-plan-contract-20260924.md) is +implemented by a private consumed-source plan borrowing one whole desired +Project. It validates every non-name field, simultaneous global/scoped names, +the complete original-coordinate edit set, current bundle identity and combined +output sizes. It does not emit or admit rewritten source, activate public +source8 or integrate into the published Windows preview. + +Windows gnullvm, rustc/Cargo 1.98.1: **17 new tests pass**, and strict core +all-target Clippy passes. The actual listing contains **246 names**. The full +library remains **FAILED: 230 passed, 16 failed**; all 229 prior outcomes and +all 16 failure bodies are unchanged (only numeric thread IDs normalized). +Formatting remains **FAILED**, byte-identical to the eight inherited blocks in +five files. Linux/WSL checks were not run. + +[Independent runtime review](RENAME-PLAN-RUNTIME-REVIEW.md) verifies all 551 +declared inputs against immutable Git and working bytes, exact named outcomes, +launchers and the 42,081,792-byte test executable, SHA256 +`2c8bd7b9a6adfda3f74b74bae00453b1b1348cbed47f04c8e8c1de9152899416`. +[Source review](RENAME-PLAN-SOURCE-REVIEW.md) applies to unchanged production +rename bytes; the module-wiring file was subsequently normalized to LF, SHA256 +`bd0cea93721a23cb2aaad1f1cb1893b45a5ba38dc6067a0c99d6a05c9bab42dd`. +[Test review](RENAME-PLAN-TEST-REVIEW.md) and the +[independent oracle](RENAME-PLAN-ORACLE.md) cover complete OA/SA and Unicode/CRLF +maps, scoped swaps, all 36 ordinary-category edits, historical exclusion, +same-spelling wrong-callee corruption, unsupported semantic changes and +signed-zero equivalence. No expectations were generated from planner output. + +Actual inherited entry caps B+37/B+38 clear all predecessor phases and separate +the final reservation refusal from success retaining R+M=38 entries. The +included-file variant preserves its precise diagnostic. With a 930-byte input +cap, ordinary alias shrink offsets typed growth to a valid complete 924 bytes; +the 933-byte variant refuses, counting the untouched file. These are planning +sizes, not emitted-output acceptance. + +The [stack investigation](RENAME-PLAN-STACK-DIAGNOSIS.md) preserves three initial +focused aborts, two marker runs, the original artifact's explicitly filtered +16-test pass, two prologue observations and three debugger runs. LLDB located +an overflow in parsing/exact-number conversion before the planner. One debugger +run passed the same artifact, so no precise cause for environmental variation +is asserted. The final evaluator prepares source/desired prerequisites on the +normal test thread, then moves the complete source owner into a 128 KiB scoped +worker for planning and destruction. All six deep/wide success/collision/ +non-name cases pass. This meets the planner-specific small-stack contract; +**the prior full-pipeline 128 KiB setup failure remains unresolved**. + +[evidence.zip](evidence.zip) contains 76 members, **584,235 bytes**, SHA256 +`1c041d181540b474e14e80677cfe287d305951eaee48e492de7f59dcdea2391c`. +[manifest.json](manifest.json) pins every member. Raw initial/final gates, +baseline records, exact launchers, diagnostic scripts/logs, source differences, +oracles and reviews are preserved. The nine readable review/checker artifacts +mirrored from the archive retain exact bytes; the critique navigation page links +to its earlier authoritative home. Toolchain version text is the previously captured, +unchanged local toolchain record, not a newly executed version probe. + +Reproduce subject gates from the exact source with the project Windows toolchain, +one compiler job, `CARGO_INCREMENTAL=0`, and no lifecycle or RUST_MIN_STACK override: + +```text +cargo test --locked --offline -p oa-core --lib -- --list +cargo test --locked --offline -p oa-core --lib language::analysis_source::mixed::project::ordinary_index::rename::tests:: -- --test-threads=1 +cargo test --locked --offline -p oa-core --lib -- --test-threads=1 +cargo clippy --locked --offline -p oa-core --all-targets -- -D warnings +cargo fmt --all -- --check +``` + +Raw replay helpers retain the producing machine's directory layout and must be +read before reuse. Receipts bind declared inputs and recorded environment fields; +they are not exhaustive environmental capture or authenticated build provenance. +The readback checker does not invoke Cargo or the executable. Do not treat a +debugger's process exit zero as a passing ordinary test. + +Actual emission/readmission with carried output storage, scalar/structural +editing, public source8, persistence/history and graphical/API parity remain +required work under issue7. The selected successor direction and rejected +envelope approach are recorded in [DECISIONS.md](../../DECISIONS.md). diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-CRITIQUE.md b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-CRITIQUE.md new file mode 100644 index 00000000..2618472a --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-CRITIQUE.md @@ -0,0 +1,5 @@ +# Rename-plan critique + +The authoritative [pre-implementation critique](../../analysis-mixed-rename-plan-20260924/RENAME-PLAN-CRITIQUE.md) +contains the expression-scratch proof cited by the preserved source review. +This page keeps that historical relative link navigable without duplicating it. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE-RAW.txt b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE-RAW.txt new file mode 100644 index 00000000..7b8dda9f --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE-RAW.txt @@ -0,0 +1,11 @@ +RICH OA R 11 M 27 E 15 Q 11 files [(213, 5, 5, 213), (213, 5, 5, 213), (474, 17, 17, 474)] CRLF [(226, 5, 5, 226), (226, 5, 5, 226), (491, 17, 17, 491)] +ORIGINAL [[0, 12, 13, "G10", "f"], [0, 68, 69, "P10.1", "x"], [0, 128, 129, "P10.12", "y"], [0, 203, 204, "P10.1", "x"], [0, 208, 209, "P10.12", "y"], [1, 12, 13, "G11", "g"], [1, 68, 69, "P11.1", "x"], [1, 128, 129, "P11.12", "y"], [1, 203, 204, "P11.1", "x"], [1, 208, 209, "P11.12", "y"], [2, 19, 20, "G1", "p"], [2, 122, 123, "G4", "n"], [2, 177, 178, "G5", "d"], [2, 189, 190, "G3", "v"], [2, 206, 207, "G3", "v"], [2, 269, 270, "G2", "w"], [2, 291, 292, "G10", "f"], [2, 293, 294, "P10.12", "y"], [2, 299, 300, "P10.1", "x"], [2, 303, 304, "G11", "g"], [2, 305, 306, "P11.1", "x"], [2, 311, 312, "P11.12", "y"], [2, 321, 322, "G10", "f"], [2, 323, 324, "P10.1", "x"], [2, 329, 330, "P10.12", "y"], [2, 350, 351, "G2", "w"], [2, 412, 413, "G5", "d"]] +TRANSFORMED [[0, 20, 21, "G10", "f"], [0, 77, 78, "P10.1", "x"], [0, 138, 139, "P10.12", "y"], [0, 214, 215, "P10.1", "x"], [0, 219, 220, "P10.12", "y"], [1, 20, 21, "G11", "g"], [1, 77, 78, "P11.1", "x"], [1, 138, 139, "P11.12", "y"], [1, 214, 215, "P11.1", "x"], [1, 219, 220, "P11.12", "y"], [2, 28, 29, "G1", "p"], [2, 133, 134, "G4", "n"], [2, 188, 189, "G5", "d"], [2, 200, 201, "G3", "v"], [2, 218, 219, "G3", "v"], [2, 281, 282, "G2", "w"], [2, 303, 304, "G10", "f"], [2, 305, 306, "P10.12", "y"], [2, 311, 312, "P10.1", "x"], [2, 315, 316, "G11", "g"], [2, 317, 318, "P11.1", "x"], [2, 323, 324, "P11.12", "y"], [2, 333, 334, "G10", "f"], [2, 335, 336, "P10.1", "x"], [2, 341, 342, "P10.12", "y"], [2, 363, 364, "G2", "w"], [2, 426, 427, "G5", "d"]] +RICH SA R 12 M 28 E 15 Q 12 files [(213, 5, 5, 213), (213, 5, 5, 213), (548, 18, 18, 548)] CRLF [(226, 5, 5, 226), (226, 5, 5, 226), (565, 18, 18, 565)] +ORIGINAL [[0, 12, 13, "G10", "f"], [0, 68, 69, "P10.1", "x"], [0, 128, 129, "P10.12", "y"], [0, 203, 204, "P10.1", "x"], [0, 208, 209, "P10.12", "y"], [1, 12, 13, "G11", "g"], [1, 68, 69, "P11.1", "x"], [1, 128, 129, "P11.12", "y"], [1, 203, 204, "P11.1", "x"], [1, 208, 209, "P11.12", "y"], [2, 19, 20, "G1", "p"], [2, 122, 123, "G4", "n"], [2, 177, 178, "G5", "d"], [2, 189, 190, "G3", "v"], [2, 206, 207, "G3", "v"], [2, 269, 270, "G2", "w"], [2, 291, 292, "G10", "f"], [2, 293, 294, "P10.12", "y"], [2, 299, 300, "P10.1", "x"], [2, 303, 304, "G11", "g"], [2, 305, 306, "P11.1", "x"], [2, 311, 312, "P11.12", "y"], [2, 321, 322, "G10", "f"], [2, 323, 324, "P10.1", "x"], [2, 329, 330, "P10.12", "y"], [2, 350, 351, "G2", "w"], [2, 412, 413, "G5", "d"], [2, 490, 491, "G6", "s"]] +TRANSFORMED [[0, 20, 21, "G10", "f"], [0, 77, 78, "P10.1", "x"], [0, 138, 139, "P10.12", "y"], [0, 214, 215, "P10.1", "x"], [0, 219, 220, "P10.12", "y"], [1, 20, 21, "G11", "g"], [1, 77, 78, "P11.1", "x"], [1, 138, 139, "P11.12", "y"], [1, 214, 215, "P11.1", "x"], [1, 219, 220, "P11.12", "y"], [2, 28, 29, "G1", "p"], [2, 133, 134, "G4", "n"], [2, 188, 189, "G5", "d"], [2, 200, 201, "G3", "v"], [2, 218, 219, "G3", "v"], [2, 281, 282, "G2", "w"], [2, 303, 304, "G10", "f"], [2, 305, 306, "P10.12", "y"], [2, 311, 312, "P10.1", "x"], [2, 315, 316, "G11", "g"], [2, 317, 318, "P11.1", "x"], [2, 323, 324, "P11.12", "y"], [2, 333, 334, "G10", "f"], [2, 335, 336, "P10.1", "x"], [2, 341, 342, "P10.12", "y"], [2, 363, 364, "G2", "w"], [2, 426, 427, "G5", "d"], [2, 505, 506, "G6", "s"]] +CATEGORY R15 M36 E0 Q15 [(2152, 127, 120, 2145)] +CATEGORY [[0, 19, 20, "G1", "p"], [0, 168, 169, "G2", "a"], [0, 249, 254, "G3", "child"], [0, 344, 345, "G2", "a"], [0, 369, 377, "G4", "implicit"], [0, 487, 488, "G5", "s"], [0, 561, 565, "G6", "link"], [0, 625, 630, "G3", "child"], [0, 640, 648, "G4", "implicit"], [0, 664, 665, "G7", "d"], [0, 741, 745, "G6", "link"], [0, 789, 793, "G6", "link"], [0, 818, 822, "G8", "note"], [0, 885, 889, "G6", "link"], [0, 925, 926, "G9", "t"], [0, 992, 997, "G3", "child"], [0, 1003, 1004, "G5", "s"], [0, 1328, 1329, "G10", "q"], [0, 1391, 1394, "G12", "use"], [0, 1397, 1402, "G14", "right"], [0, 1422, 1425, "G11", "sub"], [0, 1487, 1491, "G13", "left"], [0, 1514, 1517, "G12", "use"], [0, 1577, 1578, "G10", "q"], [0, 1617, 1620, "G11", "sub"], [0, 1648, 1652, "G13", "left"], [0, 1712, 1715, "G11", "sub"], [0, 1741, 1746, "G3", "child"], [0, 1789, 1794, "G14", "right"], [0, 1855, 1856, "G10", "q"], [0, 1882, 1890, "G4", "implicit"], [0, 1935, 1942, "G15", "context"], [0, 2004, 2005, "G10", "q"], [0, 2029, 2032, "G12", "use"], [0, 2047, 2051, "G13", "left"], [0, 2092, 2097, "G14", "right"]] +COMBINED SIZE renamed_f [(213, 1, 9, 221), (213, 0, 0, 213), (504, 33, 19, 490)] total 924 typed-only 954 +COMBINED SIZE renamed_func [(213, 1, 12, 224), (213, 0, 0, 213), (504, 33, 25, 496)] total 933 typed-only 963 +PASS: authored raw token positions and separate removed/replacement lengths only; no application pipeline/output or semantic acceptance. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE.md b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE.md new file mode 100644 index 00000000..b698a1b9 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-ORACLE.md @@ -0,0 +1,123 @@ +# 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. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-RUNTIME-READBACK.json b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-RUNTIME-READBACK.json new file mode 100644 index 00000000..0f14ca57 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-RUNTIME-READBACK.json @@ -0,0 +1,53 @@ +{ + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "baseline": "ee500908e3d77182ddd54e12524f9b6c6eb43b60", + "inputs": 551, + "unchanged_old_outcomes": 229, + "added_passed": 17, + "full_passed": 230, + "identical_failure_blocks_after_pid_only_normalization": 16, + "identical_fmt_sha256": "c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d", + "receipts": { + "rename-focused-18073a6-1": { + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "exit": 0, + "outcomes": 17, + "listing": 0, + "log_sha256": "193e7d2c82c65f2bb04d1d818835635152b702b5da56cae9c16fc6955f1cf091", + "result_sha256": "593d928b792c1f6b0a78c5f1142cfba9ab2645dbef04e21ccefd4b0eec88a50f" + }, + "rename-full-18073a6-1": { + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "exit": 101, + "outcomes": 246, + "listing": 0, + "log_sha256": "a3fef7c640ec9e59484d15b18a5fc8b9a0c25ca9bf01750b1da4431a101c4eec", + "result_sha256": "4228f67a45fca37841607d574af9b676d1c144e3a93f6d0dd34bd9c01c625d34" + }, + "rename-list-18073a6-1": { + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "exit": 0, + "outcomes": 0, + "listing": 246, + "log_sha256": "05e09d5280508a784dd97a894c92b8cdeb202c67592498d253e8f8c33b07e6ae", + "result_sha256": "1e58a6c4e907fd02c0c5a3e6de18bca3ef0c36c4a2dde2584e8e51b1837d8cda" + }, + "rename-clippy-18073a6-1": { + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "exit": 0, + "outcomes": 0, + "listing": 0, + "log_sha256": "5f9c5607b71d64c343e6be3278aeba235ce95af6b9d28d8de7e2679560afa663", + "result_sha256": "b03333e034e3668444603f71ee253d5058412b98b95507ed8d1a13e2a1439390" + }, + "rename-fmt-18073a6-1": { + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "exit": 1, + "outcomes": 0, + "listing": 0, + "log_sha256": "c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d", + "result_sha256": "2f2ed68a8b90f5908d309c7a7cf6fd2d275dc3286a4b5dd518bf0d60e33e13c7" + } + }, + "scope": "Read-only committed-input/raw-log/artifact comparison; no Cargo execution." +} diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-RUNTIME-REVIEW.md b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-RUNTIME-REVIEW.md new file mode 100644 index 00000000..a59df1af --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-RUNTIME-REVIEW.md @@ -0,0 +1,57 @@ +# Independent rename-plan runtime reconciliation + +2026-09-24. Final tested source **18073a6f2eabce83fc83997f094e331eec835a16**, baseline **ee500908e3d77182ddd54e12524f9b6c6eb43b60**. No material discrepancy found in final recorded gates or their qualified disposition: **17 new tests pass; strict Clippy passes; full library remains FAILED230pass/16fail; formatting remains FAILED**. Preserved upstream128KiB pipeline failures remain an unresolved limitation, not a fixed production issue. + +## Read-only evaluator and source binding + +Read the complete parent checker before executing it; earlier review's duplicate-list, summary-status/filtered-count, focused-status, raw-baseline and Git replacement-object concerns are addressed in this version. Executed only: + +```text +python -B .local/analysis-mixed-index-seam-20260924/inspect_rename_runtime.py 18073a6f2eabce83fc83997f094e331eec835a16 18073a6 17 +``` + +Assertions enabled; exit0. No Cargo, application binary, archived launcher or debugger was executed. Checker writes only a fresh readback JSON. Additional reviewer snippets read raw JSON/logs/ZIP and compare hashes; no source edits, commits or remote writes occurred. + +| Reproducible artifact | Bytes | SHA256 | +| --- | ---: | --- | +| inspect_rename_runtime.py | 7468 | `68e428c8959ab8a98a06ac240fc379c734646e38cbb2ca4cdec47a3672ad3c02` | +| RENAME-PLAN-RUNTIME-READBACK.json | 2211 | `9b2d1631e8981ab01aa133cbc5cd41b407e9a40280f4f91921ce9c1f6500cc11` | +| Final test executable | 42,081,792 | `2c8bd7b9a6adfda3f74b74bae00453b1b1348cbed47f04c8e8c1de9152899416` | + +Current exact executable at `.local/analysis-checked-save-target-20260913/debug/deps/oa_core-416e35542925bed6.exe` was rehashed against final focused/full/list records and their raw invocation paths. This is observed recorded-build binding, not authenticated compilation/reproducibility proof. + +All **551** declared input paths from immutable final Git tree match raw disk lengths/bytes/SHA256 and each final gate input manifest. Git replacement objects were disabled. Current checkout is the exact source with no tracked changes. Shared final input-manifest SHA256 **e2c710230fa55bbefb4faeee73dab6b8104ddfb8f0291eef0eba15850799c2ff**. All five receipts report unchanged inputs, no verification failures and same final head; captured launcher SHA256 **843069930cd44278eef940930369b5a85a3b3412e1e50793d78d3d5738298fbe** matches before/after and actual captured bytes. Exact Cargo argv/cwd match intended commands; one compiler job, incremental0 and no lifecycle/RUST_MIN_STACK overrides are recorded. The declared input scope/environment subset is not claimed exhaustive toolchain or host attestation. + +## Actual final results + +| Gate suffix18073a6-1 | Exit | Raw outcome | Log SHA256 | +| --- | ---: | --- | --- | +| focused | 0 | 17pass,0fail,0ignore,229filtered | `193e7d2c82c65f2bb04d1d818835635152b702b5da56cae9c16fc6955f1cf091` | +| full | 101 | 230pass,16fail,0ignore,0filtered | `a3fef7c640ec9e59484d15b18a5fc8b9a0c25ca9bf01750b1da4431a101c4eec` | +| list | 0 | 246 unique names | `05e09d5280508a784dd97a894c92b8cdeb202c67592498d253e8f8c33b07e6ae` | +| clippy | 0 | core/all-target strict `-D warnings`; completed dev | `5f9c5607b71d64c343e6be3278aeba235ce95af6b9d28d8de7e2679560afa663` | +| fmt | 1 | unchanged inherited formatting diff | `c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d` | + +Parsed every actual named result and compared receipt order, uniqueness, summary status/counts/filtered counts and expected exits. Listing set equals full-result set. The17 new names equal the exact focused set, all pass in both runs; all229 baseline named outcomes retain their prior result (213pass/16fail). All16 raw failure bodies compare exactly after CRLF handling and thread-PID-only normalization; no semantic diagnostics are removed. Final formatting raw bytes equal baseline, retaining eight diff blocks across five files. + +Separately anchored baseline receipts, raw logs and input manifests for ordinary-full/fmt-ee50090-1 to the previously delivered50-member archive SHA256 **99ee3761a77c2f634d36d4cdd0c3ec6d305cbd2f3322cf37a2f25f21e6d9fbed**; every compared byte matches. Thus baseline was not silently revised to permit final failures. Exact final result-record hashes are captured in the readback JSON. + +## Preserved failures and diagnostic scope + +Read/rehashed original records and logs; validated captured ordinary/diagnostic launcher and input-manifest pins. Ordinary focused attempts9388fcf,70c20c3,f1c0956 each record exit3221225725 (`0xc00000fd`, STATUS_STACK_OVERFLOW), exactly four completed passes and no terminal test summary. They are not passing17-test runs. Log SHA256 respectively: + +- 9388fcf: `92c0ef7acfaced00ec32a6f66203dd5b7e59fa3c10f844942c0f1e9291dc1a4d`. +- 70c20c3: `5ec1947d09e48c61c98d2396d176dd6acd6d8f72bbabab5ccca402908ce5faba`. +- f1c0956: `6e0542f463091d5b3924242c1aa4824dc9ab6dd076d22a018b09a9ada81d55d0`. + +The separately recorded original9388-artifact invocation uses explicit `--skip` for only the small-stack case. Raw16pass/0fail/230filtered results equal precisely the final17-name set minus that case. Receipt artifact matches original focused42,074,624-byte executable SHA256 **bd927d4653a8915ee72d5df22096d29edb1853c12d929e20056647b05e565956** and records unchanged bytes; its read source-reviewed launcher pins/checks the artifact before running. Remaining16 log SHA256 **5ce011d7c1d09165363c44fb3dc248c3aaa8b916ce1a2bac0896a76d6814501c**. Historical binary bytes have since been replaced at the shared target path; this review rechecks their preserved receipts/linkage, not a currently retained original executable. + +Diagnostic9e8e77e log **c4093678295bae3ef37ec125e707069187ca2d52dac6f09a00eaf3b28313a705** shows deep admission, original clone, successful planning/drop and desired clone completed before collision helper. Diagnostic8159a17 log **5adeb05bb91878a090297c7a0580609ed8d98d9fdb5eb73039214ae0d5b35e5d** adds `entered; before authored`, with no after-authored marker. Both record the same stack-overflow status. Those markers locate that helper attempt before its planning call. + +All three debugger receipts identify the same prior f1c artifact SHA256 **b804768eccb350033fcfd01516d0c3253e43525718f42de7c75cda9a3d91c6fe**; their launcher bytes match recorded hashes. Debugger exit0 is **not** child-test success: run1 stops on stack exception, run2 shows a single test pass/245filtered under debugger, and run3 stops on stack exception then explicitly kills the process. Run3 log SHA256 **f10d5bcf20b0c4d64cb5e07eacfe7d19999a594f55a033e1e9df7b0ca79ffca0** contains a real backtrace through authored→mixed parse→Parser unit→typed declarations→binding→exact literal→Budget exact→Exact decimal→BigInt parse→Windows heap allocation. No rename-plan call appears in that stopped call path. Run2 log **4d707adebbd3c65b89aa558a99d86b463dadffcced6a9a1e98e50bdca1b77f1f** is retained as diagnostic variation, not ordinary acceptance. This supports an environment-sensitive upstream128KiB boundary, not a proved exact frame-size cause or repaired parser. + +## Accepted bounded conclusion + +Final18073a6 production is unchanged across these evaluator revisions. As independently reviewed in RENAME-PLAN-TEST-REVIEW.md, its planner-specific small-stack case performs all six deep128/wide129 × unchanged/collision/non-name cases with full original owner moved into a128KiB scoped worker, borrowed desired, exact outcomes and worker-local destruction. Admission prerequisites are prepared outside that worker. The final raw focused and full results both pass that named test. This establishes the accepted planner-scoped gate; **it does not establish that full parsing/admission reliably fits128KiB** or erase earlier aborts. + +This is private rename planning with retained source authority and sizing, not accepted rewritten output, public source8, checked persistence, history adoption, GUI/API parity, a release build or full application completion. Full-library16 failures and formatting failure remain explicit. Parent owns packaging/publication and any next capability. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-SOURCE-REVIEW.md b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-SOURCE-REVIEW.md new file mode 100644 index 00000000..f729f219 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-SOURCE-REVIEW.md @@ -0,0 +1,41 @@ +# Independent mixed rename-plan source review + +2026-09-24. **No remaining blocking source finding in the repaired production draft.** This is source review only: tests are still being authored; no compiler, Cargo, runtime gate, source edit, commit or Gitea action was performed by this reviewer. Parent owns compilation and acceptance. + +Reviewed against accepted `harness/analysis-mixed-rename-plan-contract-20260924.md` (published checkpoint `dc87babf`, local SHA256 `c5f6ede88758b958b2c52da297bd17353a7a8e8d9123c06c967029fb8401183b`) and actual private base **`ee500908e3d77182ddd54e12524f9b6c6eb43b60`**, branch `codex/analysis-mixed-rename-plan-956atf-20260924`. The accepted contract matches the preceding critique; no concrete contract discrepancy was found. + +## Exact reviewed working bytes + +Paths below start at `crates/oa-core/src/language/analysis_source/mixed/project/` in `.local/as3batch`. These are uncommitted working bytes, not a claimed tested commit. + +| File | SHA256 | +| --- | --- | +| `ordinary_index/rename.rs` | `3ce74331c962abfbf63ca7f72b286405b1ca8b266335d77c71103c900cb6e9dd` | +| `ordinary_index.rs` | `7f30ca4eaa9cb33610a70f72d08813b24ddf0c4935fa37d6caec456394b209d6` | + +The latter changes only module wiring. Its current extra blank line is routine formatting, not a semantic finding; any later formatting change requires rebinding that file hash. New test files and compilation are outside this production-only freeze. The implementer explicitly confirmed production frozen after the repairs below. + +## Findings repaired before this conclusion + +1. **Known edit-file attribution was lost.** Initial `rename.rs` SHA256 `effd0d2bb980347ff110647ed05557ecc0abfe6f54c9dc09e9fa2894ace90789` converted all construction errors with `file: None`. An edit-map entry-limit refusal at an included-file token therefore discarded known provenance and fell back to the entry/default span. Final lines14,88,102,121–123 capture `Some(location.file)` / `Some(key.0)` immediately before each selected edit insertion and carry it through `Failure::index`. Global target/name/namespace failures keep the honest no-specific-file fallback. The existing helper continues validating canonical file/range/UTF-8 before diagnostic slicing. +2. **Calculation payload equality preceded parameter shape.** Initial code compared result/body before parameter length/ordered identity/type checks. The E bound was still safe, but this contradicted the accepted shape-first gate. Final lines361–374 check length and each parameter's ID/type at the same Vec position before result/body equality. + +Both repairs were read back directly. Required runtime controls should reach an included-file edit-allocation refusal with its real token span, and a parameter-shape mismatch before body comparison. No claim that those controls have run is made here. + +## Correctness and authority assessment + +- **Ownership (`rename.rs:6–13,125–130,150–174`):** the plan consumes AuthoredMixedProject, borrows one external immutable desired Project, and owns exactly sparse changed-name and physical-edit maps. Name slices borrow the target, never another field in the plan. Accessors are read-only; no loose-parts constructor, caller Budget, legacy Index conversion, mutable map, emitter or installation authority exists. A failed construction/validation drops the entire consumed attempt. +- **Whole target (`:319–449`):** exhaustive struct patterns cover all alias/name-exempted records. Map lengths and sorted keys are compared before corresponding records, whose own IDs are also checked. Project metadata/collection identity, definition variants and non-name data, ordered parameter shape, element/relation bodies, every diagram/node non-alias field, artifacts and complete trace baselines remain fixed. Historical content is compared opaquely, never rewritten. Current PartialEq semantics apply consistently, including signed zero in geometry, ordinary real data and historical carriers. +- **E reservation (`:16–24`):** reserves the complete retained raw-expression-site count before `same_project`, releases after all equality vectors finish, and never traverses an unpaired target-only Expr on a variant mismatch. The complete four-root reachability/frontier proof in [RENAME-PLAN-CRITIQUE.md](RENAME-PLAN-CRITIQUE.md) still applies. E=0 cannot invoke Expr equality from the admitted original. The bound is conservative logical live slots, not allocation capacity/RSS, and can refuse a no-op without headroom. +- **Names (`:31–83,450–489`):** visitation covers project, definitions and scoped parameters, elements, relations, diagrams and nested nodes, artifacts and traces, matching the authenticated catalog. Only changed names are retained. Checked cumulative candidate byte lengths precede alias-character validation. The namespace set includes changed and unchanged catalog members, separates globals from each calculation's parameters, permits final swaps and rejects changed-to-unchanged collisions. Unchanged plans skip this scratch set using the admitted namespace invariant. +- **Exact edits (`:84–147,182–258`):** both complete occurrence families contribute every changed qualified target. Insertions reserve before growth and reject duplicate physical keys. Validation checks original file/target membership, changed-name membership, nonempty exact original Word token/spelling and same-file sorted nonoverlap. Rescanning both source families requires every selected key with the correct target; required-count equality excludes extra edits without another seen set. Full reference extents, markers and trivia never become replacement ranges. This relies on sealed original occurrence completeness, as specified; it does not claim detection of arbitrary coordinated corruption of that source projection. +- **Current snapshot (`:163–174`):** equality includes SourceBundle entry and the complete path→bytes map. Touched and untouched files, removed/added/renamed paths and changed entry all fail. This is snapshot comparison, not filesystem atomicity. +- **Combined sizing (`:259–315`):** a streaming merge uses canonical files and sorted edits, separately checked removed/replacement totals, then subtraction before addition. Every file contributes, including untouched files. The complete output-byte limit is checked once without a separate typed intermediate cap; unknown trailing file keys refuse. There is no lengths map or output allocation. + +## Storage, lifecycle and remaining gates + +Equality scratch E dies before name-map growth. R retained names coexist with the Q-entry borrowed namespace set; the set is explicitly dropped before its reservation releases and before M-edit growth. Final retention is exactly **R+M entries**, zero occurrence slots and zero copied text bytes. Actual additional peak is **max(E,R+Q,R+M)** when namespace validation runs, otherwise the smaller executed phases. There are no typed Path clones, identity vectors, copied model/name strings, per-family batches, sorting buffers or extra seen sets. Refusal after a reservation leaves no reusable witness, so its whole ledger/container attempt dies together. + +Planning uses immutable Budget checks only: it does not parse, charge numeric work or change frame/Usage counters. Whole-target failures use a static diagnostic rather than formatting arbitrary target payloads. File-specific validation errors use the established safe helper. Emission, reread/admission, returned output ownership and history/save remain absent, as required for this planning dependency. + +Compilation must still confirm Rust borrow/type/macro details. Independent complete-map and phase-cap tests must demonstrate actual predecessor admission, namespace and M-growth boundaries, E wide/deep controls, diagnostic attribution, whole-target mutation refusals, stale snapshots, combined shrink/grow sizing and bounded-stack drop. Preserve all inherited full-suite/format failures and legacy Plan/Composition outcomes. This source review is not runtime acceptance, nor acceptance of rewritten source. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-STACK-DIAGNOSIS.md b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-STACK-DIAGNOSIS.md new file mode 100644 index 00000000..e692ba88 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-STACK-DIAGNOSIS.md @@ -0,0 +1,89 @@ +# Rename planner small-stack investigation + +2026-09-24, Windows gnullvm development test profile, one Cargo job. These are +observed diagnostic results; the proposed test repair still requires execution. + +- Source `9388fcf2f0b82daffec93308f42949a612b07330` compiled. Its focused run + passed four named tests, then aborted in the 128 KiB deep/wide stress test + with `STATUS_STACK_OVERFLOW` (3221225725). It did not complete the test suite. +- The exact original artifact (42,074,624 bytes, SHA256 + `bd927d4653a8915ee72d5df22096d29edb1853c12d929e20056647b05e565956`) + subsequently passed all other 16 rename tests. That direct run explicitly + skipped the known aborting case and checked the artifact before/after. It + does not establish acceptance of the complete 17-test suite. +- Diagnostic source `9e8e77e1d81c0e3116fa5777a37792a635bb4317` added flushed + phase markers only. The deep case completed admission/indexing, original + model cloning, successful planning and plan destruction, then desired-model + cloning. It aborted after entering the later collision-rejection operation. +- Diagnostic source `8159a17dd7e8083ca6b572e9b63f3a300f0d67fe` additionally + bracketed the shared rejection helper. Its final emitted marker is + `rename rejected helper: entered; before authored`. There is no + `after authored; before plan` marker. The overflow therefore occurred while + rebuilding the source through that nested helper, before the colliding plan + invocation. These markers do not identify a particular internal parser + instruction, exact compiler frame size, or general application-stack defect. + +The proposed narrow repair constructs each fresh source directly in the small +worker and invokes/matches the planner directly. It preserves the 128 KiB stack, +128-site deep and 129-site wide fixtures, full admission on that worker, +successful planning/destruction, post-equality collision refusal/destruction and +non-name refusal/destruction. It does not enlarge the stack, reduce expression +sizes, move the tested pipeline to another thread or omit failed cases. + +Production rename code remained SHA256 +`3ce74331c962abfbf63ca7f72b286405b1ca8b266335d77c71103c900cb6e9dd` +through all three source snapshots. Original and diagnostic logs/receipts, +committed-input manifests and exact launchers remain in +`.local/analysis-mixed-rename-plan-gates-20260924` until portable publication. + +## Further observed results and scoped evaluator decision + +The direct-call repair `70c20c39de4d87633a3275fda3f2bc54b20e50b7` and compact +case-loop `f1c095654a5f2a8e1592415b1392644b27169e00` both still aborted in the +same test. Neither is accepted as a repair. Read-only prologue inspection found +worker stack allocations of 10,872 and 5,976 bytes respectively; reducing that +one frame did not establish full-pipeline success. These are static observations, +not complete call-stack size measurements. + +Three LLDB runs used the exact f1 artifact (42,076,160 bytes, SHA256 +`b804768eccb350033fcfd01516d0c3253e43525718f42de7c75cda9a3d91c6fe`). +The first stopped on overflow without executing a backtrace command. The second +completed the exact single test successfully under the debugger; the third +overflowed and captured all threads before explicitly killing its owned debuggee. +Debugger process exit zero is not a passing test gate. The differing outcomes +show that this stack boundary is environment-sensitive; no cause for that +variation is claimed. + +The third backtrace places the fault in Windows heap allocation reached through +BigInt parsing, `Exact::parse_decimal`, `Budget::exact`, `Cursor::exact_literal`, +`syntax::binding`, `declarations::parse`, `State::parse_typed`, `Parser::unit`, +`mixed::parse_with_profile`, the original admission helper, and this test's +`authored` setup. The rename planner is not on that active stack. Native system +symbol labels lack full OS debug symbols and should not be treated as precise +source attribution; the executable's Rust frames establish the setup path. + +Independent evaluator review distinguishes the accepted planner-specific +requirement (small-stack comparison, success/drop and late refusal) from a +stronger full-pipeline stack claim. Prepare each fresh owner and externally +owned desired model on the normal test thread, then move the complete owner +into a scoped 128 KiB worker. That worker must invoke the planner, check exact +outcomes and destroy its plan/failure/consumed source. Desired remains an +external immutable borrow. All six deep/wide and success/collision/non-name +cases remain required, with unchanged profiles and expression counts. + +This scoped evaluator remains pending runtime validation. It will not fix or +validate the previously failing combined parser/setup path on 128 KiB. Preserve +that limitation and the failed attempts; existing standalone admission/index +small-stack tests are separate evidence only. + +## Final scoped result + +Source `18073a6f2eabce83fc83997f094e331eec835a16` implements that scoped test. +All 17 focused tests pass, including all six 128 KiB planner cases. The full +246-name run completes with 230 passed and the same 16 inherited failures. +Existing standalone small-stack cases keep their prior outcomes. The new test +artifact is 42,081,792 bytes, SHA256 +`2c8bd7b9a6adfda3f74b74bae00453b1b1348cbed47f04c8e8c1de9152899416`. +Strict core all-target Clippy passes; formatting retains the identical prior +failure bytes. These results establish the scoped planner behavior, not repair +of the separately recorded full-pipeline 128 KiB setup failure. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-TEST-REVIEW.md b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-TEST-REVIEW.md new file mode 100644 index 00000000..9b93dfbe --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/RENAME-PLAN-TEST-REVIEW.md @@ -0,0 +1,61 @@ +# Independent rename-plan test review + +2026-09-24. Reviewed settled `crates/oa-core/src/language/analysis_source/mixed/project/ordinary_index/rename/tests.rs` in `.local/as3batch`; final raw SHA256 **db20c27456ce264f02c2462c5b7c8790a5583d6d5ad7b0d6fc7820722083fb0f**. Reread final freeze after the earlier8d6209 snapshot: rich failing-cap assertion now explicitly requires main.arcadia412..413; formatting/line endings were normalized. **No remaining material test/oracle discrepancy found in these 17 tests.** Compilation and actual same-profile admission/refusal remain pending parent gates. This review did not run Cargo, source tests, archived evaluators or application pipelines, edit implementation/tests, commit or publish. + +## Independent expectations + +Compared tests with accepted root rename contract and independently authored `RENAME-PLAN-ORACLE.md` / `rename_plan_bytes.py`, not production-generated expected maps. + +- OA/SA entire changed-name maps exactly match all11/12 qualified swaps. Complete physical maps match all27/28 original-coordinate tuples, including both cross-family reference directions, canonical a/b coincident offsets, both calculation parameter scopes, and reordered/repeated/nested call labels. Unicode-prefix/full-CRLF variants use independently authored exact endpoint arrays. Output sums900/943/974/1017 and retention38/40 are correct. +- Category literal full map equals all36 authored tuples for15 changed global targets. Corrected real line-comment-separated parent reference selects only344..345; implicit parent, historical UUID, display/prose/URI/guard text contribute no extra edit. Complete desired-name map, output2145 and retention51 match the oracle. Expectations are explicit literals, not copies of produced occurrence/edit maps. +- No-op checks external desired pointer, original bundle pointer, original model, zero edits/names, unchanged complete storage/usage/numeric counters and900 bytes. Rich success checks borrowed desired-name storage and untouched original/desired models. These are planning checks, not emitted/reparsed-source acceptance. + +## Inherited budgets and sizing + +The38/37 test constructs a new parsed/resolved/typed-indexed/ordinary-indexed owner under the **same supplied inherited profile** before planning. It compares the admitted baseline then requires success retaining38 or exact entry-limit failure. There is no replacement/tightening of an accepted owner's budget. Independent arithmetic remains B=L+65, prior known peaks <=L+97 resolver/L+98 typed/L+93 ordinary, planning L+103; both caps L+102/+103 clear predecessors. Runtime must confirm the fixture actually reaches planning. + +Additional relocated diagram fixture uses a fresh fourth canonical `z.arcadia`, preserves full model and sets the inherited B+37 profile through every predecessor. It requires failure in that included file at8..9, with exact limit diagnostic. This detects loss of canonical-file attribution on a late reservation. Its literal diagram relocation is ordinary valid include syntax; actual admission is not claimed before gates. + +The930-byte case uses31 original n bytes, ordinary shrink30 and three typed f occurrences. Final `renamed_f` result924 must fit despite typed-only954; `renamed_func` result933 must fail930. Untouched b.arcadia's213 bytes are included. The test rebuilds the entire input pipeline under bytes930 and leaves other limits unrestricted. It does not disguise a predecessor failure: any such refusal fails the test before planning. Four edits and positive output924 are asserted; negative requires the exact output-byte-limit message. + +Wide/deep fixtures independently count128 unary-chain sites and129 list sites; successful no-op equality, subsequent collision refusal and binding-variant refusal occur on a128KiB thread. Zero-E original refuses target-only2048-deep/4096-wide Expr variants. Nonzero-E list length growth/shrink and call argument removal reach matching-variant equality paths. These exercise the conservative E policy but do not establish a separate E/E-minus-one global-cap boundary. The rich no-op cannot isolate that boundary because its predecessor typed peak is larger, as already documented in the oracle. No contrary claim is made. + +## Whole-target and authority controls + +Mutation groups cover project schema/identity/prose; collection removals/key changes; element identity/prose/parent/body; definition identity/prose/calculation parameter ordered identity/count/type/result/body; diagram identity/prose/layer/projection/view options/routes/nodes; node identity/element/geometry/collapse/port anchors; relation identity/prose/body; artifact identity/prose/owner/relation/URI/revision/fragment; trace identity/prose/endpoints/kind/baseline/semantic/history. QuantityKind algebra, Unit symbol and definition-body variant are explicit direct `same_project` controls; their deliberately synthesized Projects are not represented as admitted runtime fixtures. + +Geometry signed zero is supplemented by admitted-source OA/SA Real minimum/default and historical RealMinimum values changing+0 to-0. Source inspection supports the fixture syntax: ordinary Real/Value encoding is valid; TraceKind::Item permits DataType↔DataType with canonical OA/SA endpoints; finite0/1 bounds and0 defaults are compatible. These facts remove a likely authoring error, but only pending gates establish actual admission. No non-name source rewriting is authorized by equality. + +Final namespace tests distinguish changed→unchanged global collision, scoped collision, invalid/reserved/Unicode alias, and same spelling in separate scopes. Complete-bundle checks reject changed entry, missing/extra/path-renamed files, touched-byte changes and changed **untouched** a.arcadia bytes. + +Corruption checks include missing/extra/wrong-target/out-of-file/empty/invalid UTF-8/extended-overlapping ranges. Safe fallback span/path are asserted for the malformed UTF-8 and missing file. Crucially, the final added scoped corruption substitutes P(11,1) for P(10,1) at main299..300: identical original x and desired y spellings cannot mask the wrong callee identity, and the test requires the exact missing-required-target diagnostic at the original file/span. Another added control inserts a valid unchanged node token and requires unchanged-target refusal. These reach deeper authority checks than simple f/g spelling mismatch. + +## Findings resolved before gates + +Initial wide expression test used unsupported `List`; reported to implementer and corrected to **List(Number)**, consistent with declarations grammar and existing literal tests. Initial wrong-target corruption failed on different f/g spelling before qualified association; the same-spelling scoped case now addresses that gap. Missing scalar/historical signed-zero, port-anchor, opaque definition and nonzero list/call-size controls were added and reread. No expectations were weakened to match runtime output; no runtime output existed during this review. + +Parent must preserve all prior229-name outcomes (213pass/16known failures), original formatting failure and explicit source pin, and reconcile each new named test from actual logs. This is source-level evaluator review, not evidence that these tests compile/pass or that output emission, public source8, persistence, history or GUI/API parity is complete. + +## Narrow small-stack repair rereview — source70c20c3 + +After the initial source9388fcf2f0b82daffec93308f42949a612b07330 compiled but aborted its focused run on the small-stack test, the parent retained that failure, the exact original-artifact remaining16 passes, and diagnostic9e8e77e1/8159a17d attempts. The reported final markers locate overflow inside `rejected` helper's fresh `authored(bundle)` setup before that invocation entered rename planning. This identifies a test setup call boundary, not a proven compiler frame-size or cloning cause. Original hash/disposition above remains history, not a claim of17 passing tests. + +Read immutable diff9388fcf2f0b82daffec93308f42949a612b07330→70c20c39de4d87633a3275fda3f2bc54b20e50b7. Exactly two files change: the small-stack test and its implementation-note failure/repair account. No production or other test/oracle change. Final test bytes SHA256 **629fed6da8c59c9b5f3dd980f46476ce094cb6119841966492f623dd8d81f7af**. + +The test now directly constructs each fresh owner in the worker and matches the collision/non-name planning failure there, instead of nesting that entire admission chain in the general rejection helper. It explicitly asserts the complete failure messages, drops failure/desired before the next case, and drops original at iteration end. Still128KiB,128 deep unary sites and129 wide list sites; complete parsing/resolution/both indexes remain on that same worker. Successful plan/drop and both failure/drop paths remain for both shapes. No `forget`, larger thread, smaller fixture or skipped failure path replaces them. This is a faithful narrow setup repair; no further test change is requested from this review. All17 repaired focused tests and broader same-source gates remain pending parent verification; no runtime checker was executed here. + +## Compact case-loop candidate — sourcef1c0956 + +Parent subsequently observed another stack overflow at70c20c3; its source review above is **not runtime acceptance** and that failed attempt remains preserved. Read only the immutable70c20c3→f1c095654a5f2a8e1592415b1392644b27169e00 test/note delta. The new loop shares one source/desired/result local layout for modes0 unchanged,1 final-namespace collision,2 non-name Binding mutation. Each mode independently admits the full source on the same128KiB worker, verifies128/129 old expression sites, clones its desired model, runs planning, checks the appropriate success or complete diagnostic, and drops plan/failure plus desired. Both original deep/wide literals remain; all17 test names remain. No semantic case, source-admission stage or ownership/drop boundary was removed. No coverage objection to this narrow candidate. + +The parent's observed70c executable fixed prologues (worker10872B, authored2984B, rejected1800B) are evidence about that binary's fixed frames, not an actual runtime call stack or exact overflow instruction. A shared-layout hypothesis motivates this candidate but is not a verified sole cause. This review did not execute tests or the frame inspector; f1c runtime and any compiled-frame comparison remain parent-owned and pending. + +## Planner-scoped worker rereview — source18073a6 + +The f1c compact candidate also overflowed; it is not accepted as a repaired combined pipeline. Parent subsequently reported debugger observations locating the failing f1c run3 inside upstream exact-literal parsing/BigInt allocation before rename planning, with one pass under debugger among three debugger runs. These parent observations explain the evaluator-scope decision; this source review did not independently replay the debugger, and a debugger pass is not ordinary runtime acceptance. + +Read immutable diff f1c095654a5f2a8e1592415b1392644b27169e00→18073a6f2eabce83fc83997f094e331eec835a16. Test hash **fa455ea90d9d220a18fa7eee9179eb5cc5895a5f7350197884126c66c18b60f7**. Only the small-stack evaluator and implementation-note explanation change; production remains unchanged. + +The actual code faithfully implements the independently reviewed narrower gate: for each deep128/wide129 shape and each of three outcomes it builds a fresh full admitted owner on the normal test thread, checks old expression count, creates the desired intent, then calls `spawn_scoped` with128KiB and a **move** closure capturing the owner plus borrowed `&desired`. `plan_rename` runs inside that closure. Success requires mode0, empty edits and the exact desired borrow, then explicitly drops the plan in the worker. Failure requires nonzero mode, one exact collision/non-name diagnostic and drops the failure in the worker; the consumed original owner is destroyed inside failed planning. The closure returns only unit. The scope joins before the external desired Project drops. No policy or live ledger is replaced and no source/edit authority escapes for destruction on a larger stack. + +This is faithful to the accepted **planner comparison/success-drop/late-refusal** gate, not proof of full upstream admission on128KiB. All six planner cases, both old expression sizes and128KiB remain. The full-pipeline failed observations stay an explicit unresolved environment-sensitive stack boundary; existing independent admission/index small-stack tests do not erase them. No further source change requested by this bounded review. All17 final focused tests and five-gate runtime reconciliation still await parent readiness; no checker or Cargo was executed here. diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/evidence.zip b/harness/experiments/analysis-mixed-rename-plan-20260924/evidence.zip new file mode 100644 index 00000000..ce5bd5fc Binary files /dev/null and b/harness/experiments/analysis-mixed-rename-plan-20260924/evidence.zip differ diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/inspect_rename_runtime.py b/harness/experiments/analysis-mixed-rename-plan-20260924/inspect_rename_runtime.py new file mode 100644 index 00000000..b3dd3339 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/inspect_rename_runtime.py @@ -0,0 +1,134 @@ +"""Reconcile committed Windows rename-plan gates against raw logs and prior outcomes.""" +from pathlib import Path +import hashlib +import json +import re +import subprocess +import sys + +base = Path(__file__).resolve().parents[2] +root = base / '.local/as3batch' +directory = base / '.local/analysis-mixed-rename-plan-gates-20260924' +prior = base / '.local/analysis-ordinary-index-gates-20260924' +source, stem, expected_added = sys.argv[1], sys.argv[2], int(sys.argv[3]) +assert expected_added == 17 +assert re.fullmatch(r'[0-9a-f]{40}', source) +assert re.fullmatch(r'[a-zA-Z0-9-]+', stem) +sha = lambda raw: hashlib.sha256(raw).hexdigest() + +def git(*args): + return subprocess.check_output(['git', '--no-replace-objects', *args], cwd=root) + +def receipt(folder, name): + path = folder / (name + '.result.json') + data = json.loads(path.read_bytes()) + raw = (folder / (name + '.log')).read_bytes() + assert data['log_sha256'] == sha(raw) + return data, raw + +assert git('rev-parse', 'HEAD').decode().strip() == source +assert not git('status', '--porcelain', '--untracked-files=no').strip() +scope = ['Cargo.toml', 'Cargo.lock', 'rust-toolchain.toml', '.cargo', 'build', 'crates', 'assets', 'docs', 'examples', 'harness/fixtures', 'vendor'] +paths = git('ls-tree', '-r', '--name-only', source, *scope).decode().splitlines() +blobs = subprocess.check_output(['git', '--no-replace-objects', 'cat-file', '--batch'], cwd=root, + input=''.join(f'{source}:{p}\n' for p in paths).encode()) +offset = 0 +expected_inputs = [] +for path in paths: + end = blobs.index(b'\n', offset) + _, kind, count = blobs[offset:end].split() + count = int(count) + raw = blobs[end + 1:end + 1 + count] + assert kind == b'blob' and (root / path).read_bytes() == raw, path + expected_inputs.append({'path': path, 'bytes': count, 'sha256': sha(raw)}) + offset = end + count + 2 +assert offset == len(blobs) +prefix = ['cargo', 'test', '--locked', '--offline', '-p', 'oa-core', '--lib'] +focus = 'language::analysis_source::mixed::project::ordinary_index::rename::tests::' +commands = { + 'focused': prefix + [focus, '--', '--test-threads=1'], + 'full': prefix + ['--', '--test-threads=1'], + 'list': prefix + ['--', '--list'], + 'clippy': ['cargo', 'clippy', '--locked', '--offline', '-p', 'oa-core', '--all-targets', '--', '-D', 'warnings'], + 'fmt': ['cargo', 'fmt', '--all', '--', '--check'], +} +verified = {} +all_receipts = {} +for mode, command in commands.items(): + name = f'rename-{mode}-{stem}-1' + data, raw = receipt(directory, name) + assert data['source'] == data['head_after'] == source + assert data['mode'] == mode and data['command'] == command + assert not data['changed_inputs'] and not data['verification_failures'] + manifest_raw = (directory / data['inputs']).read_bytes() + assert sha(manifest_raw) == data['inputs_sha256'] + assert json.loads(manifest_raw) == {'source': source, 'inputs': expected_inputs} + launcher = (directory / data['launcher_copy']).read_bytes() + assert sha(launcher) == data['launcher_sha256'] == data['launcher_sha256_after'] + assert source.encode() in launcher + env = data['environment'] + assert env['CARGO_BUILD_JOBS'] == '1' and env['CARGO_INCREMENTAL'] == '0' + assert env['ARCADIA_CODEC_LIFECYCLE_PHASE'] is None and env['RUST_MIN_STACK'] is None + assert data['cwd'] == str(root) + text = raw.decode() + outcomes = re.findall(r'^test ([^\r\n]+) \.\.\. (ok|FAILED|ignored)\r?$', text, re.M) + assert outcomes == [tuple(x) for x in data['outcomes']] + assert len(outcomes) == len(dict(outcomes)) + members = re.findall(r'^([^\r\n]+): test\r?$', text, re.M) if mode == 'list' else [] + assert members == data['listing_members'] and len(members) == data['listing_count'] + assert len(members) == len(set(members)) + if mode == 'list': + assert len(members) == 229 + expected_added + if mode in ('focused', 'full'): + counts = tuple(sum(v == state for _, v in outcomes) for state in ('ok', 'FAILED', 'ignored')) + summary = re.findall(r'^test result: (ok|FAILED)\. (\d+) passed; (\d+) failed; (\d+) ignored; 0 measured; (\d+) filtered out;', text, re.M) + assert len(summary) == 1 and tuple(map(int, summary[0][1:4])) == counts + assert summary[0][0] == ('FAILED' if counts[1] else 'ok') + assert int(summary[0][4]) == (229 if mode == 'focused' else 0) + assert data['exit'] == (101 if counts[1] else 0) + assert len(data['artifacts']) == 1 + for artifact in data['artifacts']: + actual = Path(artifact['path']).read_bytes() + assert len(actual) == artifact['bytes'] and sha(actual) == artifact['sha256'] + assert str(Path(artifact['path'])).replace('\\', '/') in text.replace('\\', '/') + all_receipts[mode] = data + verified[name] = {'source': source, 'exit': data['exit'], 'outcomes': len(outcomes), 'listing': len(members), 'log_sha256': sha(raw), 'result_sha256': sha((directory / (name + '.result.json')).read_bytes())} + +old, old_raw = receipt(prior, 'ordinary-full-ee50090-1') +assert old['source'] == 'ee500908e3d77182ddd54e12524f9b6c6eb43b60' +old_actual = re.findall(r'^test ([^\r\n]+) \.\.\. (ok|FAILED|ignored)\r?$', old_raw.decode(), re.M) +assert old_actual == [tuple(x) for x in old['outcomes']] +assert len(old_actual) == len(dict(old_actual)) == 229 +old_out = dict(old['outcomes']) +new_out = dict(all_receipts['full']['outcomes']) +assert len(old_out) == 229 and len(new_out) == 229 + expected_added +assert all(new_out.get(k) == v for k, v in old_out.items()) +added = set(new_out) - set(old_out) +assert len(added) == expected_added and all(new_out[k] == 'ok' and k.startswith(focus) for k in added) +assert set(dict(all_receipts['focused']['outcomes'])) == added +assert all(status == 'ok' for _, status in all_receipts['focused']['outcomes']) +assert set(all_receipts['list']['listing_members']) == set(new_out) +assert all_receipts['clippy']['exit'] == all_receipts['list']['exit'] == all_receipts['focused']['exit'] == 0 +assert all_receipts['fmt']['exit'] == 1 + +def failure_blocks(raw): + text = raw.decode().replace('\r\n', '\n') + return {m[1]: re.sub(r"(?m)^(thread '[^\n]*') \(\d+\) panicked", r'\1 () panicked', m[2]).strip() + for m in re.finditer(r'^---- ([^\n]+) stdout ----\n(.*?)(?=^---- |^failures:|\Z)', text, re.M | re.S)} + +new_raw = (directory / f'rename-full-{stem}-1.log').read_bytes() +old_blocks, new_blocks = failure_blocks(old_raw), failure_blocks(new_raw) +assert len(old_blocks) == len(new_blocks) == 16 and old_blocks == new_blocks +old_fmt, old_fmt_raw = receipt(prior, 'ordinary-fmt-ee50090-1') +fmt_raw = (directory / f'rename-fmt-{stem}-1.log').read_bytes() +assert fmt_raw == old_fmt_raw +result = {'source': source, 'baseline': old['source'], 'inputs': len(expected_inputs), + 'unchanged_old_outcomes': 229, 'added_passed': expected_added, + 'full_passed': sum(v == 'ok' for v in new_out.values()), + 'identical_failure_blocks_after_pid_only_normalization': 16, + 'identical_fmt_sha256': sha(fmt_raw), 'receipts': verified, + 'scope': 'Read-only committed-input/raw-log/artifact comparison; no Cargo execution.'} +destination = Path(__file__).with_name('RENAME-PLAN-RUNTIME-READBACK.json') +assert not destination.exists(), 'Preserve previous readback; use a separately named checker for another source.' +destination.write_text(json.dumps(result, indent=2) + '\n', encoding='utf-8') +print(json.dumps(result, indent=2)) diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/manifest.json b/harness/experiments/analysis-mixed-rename-plan-20260924/manifest.json new file mode 100644 index 00000000..06dd89a2 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/manifest.json @@ -0,0 +1,315 @@ +{ + "source": "18073a6f2eabce83fc83997f094e331eec835a16", + "scope": "Private complete-target rename planning only. 17 new tests and strict Clippy pass; full library has 230 passed/16 inherited failures and formatter remains failed. Prior setup stack overflows are unresolved and preserved; scoped planner gate passes.", + "archive": { + "file": "evidence.zip", + "bytes": 584235, + "sha256": "1c041d181540b474e14e80677cfe287d305951eaee48e492de7f59dcdea2391c" + }, + "members": { + "baseline/launchers/2b88d5006c81dcfb801e45559ae2e7bd948d5897f04ea1d1f34a3d42bcdd5efe.py": { + "bytes": 7637, + "sha256": "2b88d5006c81dcfb801e45559ae2e7bd948d5897f04ea1d1f34a3d42bcdd5efe" + }, + "baseline/ordinary-fmt-ee50090-1.inputs.json": { + "bytes": 102544, + "sha256": "fd3bb5cb81341352f781587b747c6272287e71570491b6e916ce71370a1d89d6" + }, + "baseline/ordinary-fmt-ee50090-1.log": { + "bytes": 6446, + "sha256": "c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d" + }, + "baseline/ordinary-fmt-ee50090-1.result.json": { + "bytes": 1883, + "sha256": "08e5bcecc03f14d50050b5d7c2116488916beea9cf651ffff35fc3d0abd79782" + }, + "baseline/ordinary-full-ee50090-1.inputs.json": { + "bytes": 102544, + "sha256": "fd3bb5cb81341352f781587b747c6272287e71570491b6e916ce71370a1d89d6" + }, + "baseline/ordinary-full-ee50090-1.log": { + "bytes": 38279, + "sha256": "d2203c5ca80ad304aadabe623e6a088fb4261f3f59d077fee24b46692417597c" + }, + "baseline/ordinary-full-ee50090-1.result.json": { + "bytes": 33238, + "sha256": "61ec0aa942f1cc527b3947b0b72ad83ac697058a03cc9137f62243477105dcf9" + }, + "baseline/ordinary-list-ee50090-1.inputs.json": { + "bytes": 102544, + "sha256": "fd3bb5cb81341352f781587b747c6272287e71570491b6e916ce71370a1d89d6" + }, + "baseline/ordinary-list-ee50090-1.log": { + "bytes": 25017, + "sha256": "7b53e4dc83a29b26c4d6419b01e0a66e4b2592bbee947f85e6cae8cbbd692325" + }, + "baseline/ordinary-list-ee50090-1.result.json": { + "bytes": 27208, + "sha256": "9c966f748893e4275bf36f6036036fd9199e3f5c05228c9e4e0a9bb97bebdf53" + }, + "diagnostics/debug_stack_f1c0956.py": { + "bytes": 1697, + "sha256": "26208c9084171b1df1a2224737f2ae97060f06946c9820a6063914cab527bac8" + }, + "diagnostics/debug_stack_f1c0956_v2.py": { + "bytes": 1736, + "sha256": "025019993240998528484a40f26a236839ebaee0e4b19a38fda1a4bc79599260" + }, + "diagnostics/debug_stack_f1c0956_v3.py": { + "bytes": 1736, + "sha256": "14ccecdc03708d236f07b9ec8b8120983de8c9af590514b3f0ea64af8f20ecd0" + }, + "diagnostics/inspect_stack_frames.py": { + "bytes": 1803, + "sha256": "14e3ca116eea0634fd5435278d48e48322489166ae280aae03c7fcb9255cb1d4" + }, + "diagnostics/rename-debugger-f1c0956-1.log": { + "bytes": 1318, + "sha256": "22f158952b553a00b1352439411b9182c852b35441fd391b686e07a7f052f35a" + }, + "diagnostics/rename-debugger-f1c0956-1.result.json": { + "bytes": 1192, + "sha256": "aae612c939444e58109ef64500a735264b24576a56bcbddaa26822ed0058fd0e" + }, + "diagnostics/rename-debugger-f1c0956-2.log": { + "bytes": 1054, + "sha256": "4d707adebbd3c65b89aa558a99d86b463dadffcced6a9a1e98e50bdca1b77f1f" + }, + "diagnostics/rename-debugger-f1c0956-2.result.json": { + "bytes": 1246, + "sha256": "be1b0821eee8277bfba134d627cea98bb9bf2eac681a738b38987ad8f41552c4" + }, + "diagnostics/rename-debugger-f1c0956-3.log": { + "bytes": 12555, + "sha256": "f10d5bcf20b0c4d64cb5e07eacfe7d19999a594f55a033e1e9df7b0ca79ffca0" + }, + "diagnostics/rename-debugger-f1c0956-3.result.json": { + "bytes": 1246, + "sha256": "3cd9af18242589b5a3e0e27410b91c69039bdcc48c8d1d7402de5ec7a2a80fd0" + }, + "diagnostics/rename-focused-70c20c3-1.stack-frames.json": { + "bytes": 8123, + "sha256": "74b596478394d38470af60f45360b06a5b3cd4128fb4d0be85088b6d1e33dabf" + }, + "diagnostics/rename-focused-f1c0956-1.stack-frames.json": { + "bytes": 8185, + "sha256": "2d2a48a75dc9b51124b8a312e5b22da6ef2ac7d42bddd18d8b8c03d6a3add411" + }, + "diagnostics/rename-remaining-9388fcf-1.log": { + "bytes": 2634, + "sha256": "5ce011d7c1d09165363c44fb3dc248c3aaa8b916ce1a2bac0896a76d6814501c" + }, + "diagnostics/rename-remaining-9388fcf-1.result.json": { + "bytes": 1265, + "sha256": "a4a0f56d3ed206cfb8c6ae12337210931041ec1633e4ab93fb5953e665f811e8" + }, + "diagnostics/run_remaining_9388fcf.py": { + "bytes": 2088, + "sha256": "edcb1ff785c18cb4ac74f2a634b834026eedb48cfeb9f4e4eecf598d55f18919" + }, + "diffs/9388fcf-to-18073a6.patch": { + "bytes": 10183, + "sha256": "d2254917fa0afb43aac140b9ae25de2fd685aa4b13c963a7bf51aec916e10db6" + }, + "diffs/ee50090-to-18073a6.patch": { + "bytes": 64770, + "sha256": "aac5271ecba3cb96552a8feef7e2ede74cf6595649aad1a8b82c36e68780c201" + }, + "gates/launchers/70bfe2c244c5c635ef312facb29ae8d3c8fece780152dfdce55b9d607c06cbb8.py": { + "bytes": 7705, + "sha256": "70bfe2c244c5c635ef312facb29ae8d3c8fece780152dfdce55b9d607c06cbb8" + }, + "gates/launchers/74587d050ab4d6130860afa961d2b2671023c20f439f282be34dba480663de86.py": { + "bytes": 7674, + "sha256": "74587d050ab4d6130860afa961d2b2671023c20f439f282be34dba480663de86" + }, + "gates/launchers/843069930cd44278eef940930369b5a85a3b3412e1e50793d78d3d5738298fbe.py": { + "bytes": 7674, + "sha256": "843069930cd44278eef940930369b5a85a3b3412e1e50793d78d3d5738298fbe" + }, + "gates/launchers/983f5ed90dce17ab2d7d58c08ddf08f0cc752dea834d35438dbe073caa9d9afe.py": { + "bytes": 7656, + "sha256": "983f5ed90dce17ab2d7d58c08ddf08f0cc752dea834d35438dbe073caa9d9afe" + }, + "gates/launchers/ae5f20a826db19c56c38a7e802deec77252cfb63b075bba095b1cb1f7de152dc.py": { + "bytes": 7705, + "sha256": "ae5f20a826db19c56c38a7e802deec77252cfb63b075bba095b1cb1f7de152dc" + }, + "gates/launchers/ce7f270d1f1167bf479255a9a803254a0c8c3f74d551c410dd6513cf5ff4447f.py": { + "bytes": 7674, + "sha256": "ce7f270d1f1167bf479255a9a803254a0c8c3f74d551c410dd6513cf5ff4447f" + }, + "gates/rename-clippy-18073a6-1.inputs.json": { + "bytes": 102986, + "sha256": "e2c710230fa55bbefb4faeee73dab6b8104ddfb8f0291eef0eba15850799c2ff" + }, + "gates/rename-clippy-18073a6-1.log": { + "bytes": 165, + "sha256": "5f9c5607b71d64c343e6be3278aeba235ce95af6b9d28d8de7e2679560afa663" + }, + "gates/rename-clippy-18073a6-1.result.json": { + "bytes": 1968, + "sha256": "b03333e034e3668444603f71ee253d5058412b98b95507ed8d1a13e2a1439390" + }, + "gates/rename-diagnostic-8159a17-1.inputs.json": { + "bytes": 102986, + "sha256": "751638cab87181471f2de6d0effe4f791880dbc2bb8f1747ce50e94823c01041" + }, + "gates/rename-diagnostic-8159a17-1.log": { + "bytes": 1374, + "sha256": "5adeb05bb91878a090297c7a0580609ed8d98d9fdb5eb73039214ae0d5b35e5d" + }, + "gates/rename-diagnostic-8159a17-1.result.json": { + "bytes": 2540, + "sha256": "0631fa66b6a172f43a103460128da7461cc2ef8a02ce4c6c12b3462f932e1dd3" + }, + "gates/rename-diagnostic-9e8e77e-1.inputs.json": { + "bytes": 102986, + "sha256": "87c5f990b15291ff1cb4a97cd8c6b3c5e84fdd240294f250cd72ad8aa0cd40e0" + }, + "gates/rename-diagnostic-9e8e77e-1.log": { + "bytes": 1325, + "sha256": "c4093678295bae3ef37ec125e707069187ca2d52dac6f09a00eaf3b28313a705" + }, + "gates/rename-diagnostic-9e8e77e-1.result.json": { + "bytes": 2540, + "sha256": "0e0f4bb7db5d756fb988e101f619d49083a24f9e60fba8f2c8b50227299ff9c0" + }, + "gates/rename-fmt-18073a6-1.inputs.json": { + "bytes": 102986, + "sha256": "e2c710230fa55bbefb4faeee73dab6b8104ddfb8f0291eef0eba15850799c2ff" + }, + "gates/rename-fmt-18073a6-1.log": { + "bytes": 6446, + "sha256": "c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d" + }, + "gates/rename-fmt-18073a6-1.result.json": { + "bytes": 1881, + "sha256": "2f2ed68a8b90f5908d309c7a7cf6fd2d275dc3286a4b5dd518bf0d60e33e13c7" + }, + "gates/rename-fmt-70c20c3-1.inputs.json": { + "bytes": 102986, + "sha256": "ac4b03694673ca205211ac60058feef17d4ff01b4eb51a7a661848e0536b1d13" + }, + "gates/rename-fmt-70c20c3-1.log": { + "bytes": 6446, + "sha256": "c1c6b12861c8117ce6ffc6d6742ebf92618aafb10160ec6f99d370ca72ebab2d" + }, + "gates/rename-fmt-70c20c3-1.result.json": { + "bytes": 1881, + "sha256": "0fc82dfbba22c52d8723ed406546dd8b998969a2b476ed9b20dfabdde11a14e9" + }, + "gates/rename-focused-18073a6-1.inputs.json": { + "bytes": 102986, + "sha256": "e2c710230fa55bbefb4faeee73dab6b8104ddfb8f0291eef0eba15850799c2ff" + }, + "gates/rename-focused-18073a6-1.log": { + "bytes": 3110, + "sha256": "193e7d2c82c65f2bb04d1d818835635152b702b5da56cae9c16fc6955f1cf091" + }, + "gates/rename-focused-18073a6-1.result.json": { + "bytes": 5413, + "sha256": "593d928b792c1f6b0a78c5f1142cfba9ab2645dbef04e21ccefd4b0eec88a50f" + }, + "gates/rename-focused-70c20c3-1.inputs.json": { + "bytes": 102986, + "sha256": "ac4b03694673ca205211ac60058feef17d4ff01b4eb51a7a661848e0536b1d13" + }, + "gates/rename-focused-70c20c3-1.log": { + "bytes": 1637, + "sha256": "5ec1947d09e48c61c98d2396d176dd6acd6d8f72bbabab5ccca402908ce5faba" + }, + "gates/rename-focused-70c20c3-1.result.json": { + "bytes": 3113, + "sha256": "9ba95c3a8c9785ce69e2b8b1c504e9557040e8c55612482469b40aed8b97cd85" + }, + "gates/rename-focused-9388fcf-1.inputs.json": { + "bytes": 102986, + "sha256": "7f4d0ec7a21a3a23db234a2329562ba620523c9a84deeb87474e092a88ab468c" + }, + "gates/rename-focused-9388fcf-1.log": { + "bytes": 1638, + "sha256": "92c0ef7acfaced00ec32a6f66203dd5b7e59fa3c10f844942c0f1e9291dc1a4d" + }, + "gates/rename-focused-9388fcf-1.result.json": { + "bytes": 3113, + "sha256": "7b7e3fd766806c9054fbbf066913127b711a993302053cee3129728fdd599d81" + }, + "gates/rename-focused-f1c0956-1.inputs.json": { + "bytes": 102986, + "sha256": "c9a3c26dd52513fddd1e803decff24d4886b20991d46d37c040e094f3336850f" + }, + "gates/rename-focused-f1c0956-1.log": { + "bytes": 1638, + "sha256": "6e0542f463091d5b3924242c1aa4824dc9ab6dd076d22a018b09a9ada81d55d0" + }, + "gates/rename-focused-f1c0956-1.result.json": { + "bytes": 3125, + "sha256": "f491a11602baee2f03249008221b3cd882c872a87750f94e889dbda5bb8b787a" + }, + "gates/rename-full-18073a6-1.inputs.json": { + "bytes": 102986, + "sha256": "e2c710230fa55bbefb4faeee73dab6b8104ddfb8f0291eef0eba15850799c2ff" + }, + "gates/rename-full-18073a6-1.log": { + "bytes": 40942, + "sha256": "a3fef7c640ec9e59484d15b18a5fc8b9a0c25ca9bf01750b1da4431a101c4eec" + }, + "gates/rename-full-18073a6-1.result.json": { + "bytes": 36268, + "sha256": "4228f67a45fca37841607d574af9b676d1c144e3a93f6d0dd34bd9c01c625d34" + }, + "gates/rename-list-18073a6-1.inputs.json": { + "bytes": 102986, + "sha256": "e2c710230fa55bbefb4faeee73dab6b8104ddfb8f0291eef0eba15850799c2ff" + }, + "gates/rename-list-18073a6-1.log": { + "bytes": 27578, + "sha256": "05e09d5280508a784dd97a894c92b8cdeb202c67592498d253e8f8c33b07e6ae" + }, + "gates/rename-list-18073a6-1.result.json": { + "bytes": 29785, + "sha256": "1e58a6c4e907fd02c0c5a3e6de18bca3ef0c36c4a2dde2584e8e51b1837d8cda" + }, + "notes/prior-toolchain.txt": { + "bytes": 536, + "sha256": "1f101518dd1f90bc2cba8d26570a762832aba6debebbbe6aa50f97a944590610" + }, + "reviews/RENAME-PLAN-ORACLE-RAW.txt": { + "bytes": 4893, + "sha256": "75880efef0bce8909e6c5079e088107464c68f19aae53f2123cb77260103f7a1" + }, + "reviews/RENAME-PLAN-ORACLE.md": { + "bytes": 11934, + "sha256": "19acc27e880981c4f6a3d6f33fea3bd3293405ec96f0f996ec7cd3121a9beeaf" + }, + "reviews/RENAME-PLAN-RUNTIME-READBACK.json": { + "bytes": 2211, + "sha256": "9b2d1631e8981ab01aa133cbc5cd41b407e9a40280f4f91921ce9c1f6500cc11" + }, + "reviews/RENAME-PLAN-RUNTIME-REVIEW.md": { + "bytes": 8120, + "sha256": "0300b8528b23dc4d46fdc09c1e84ca86402077a3392d72ffd9162ad510ed4597" + }, + "reviews/RENAME-PLAN-SOURCE-REVIEW.md": { + "bytes": 8073, + "sha256": "91c5b9876b967479d6b8382f892b9165b364ec6586cb4f73bbe9f44f8344b0cf" + }, + "reviews/RENAME-PLAN-STACK-DIAGNOSIS.md": { + "bytes": 5533, + "sha256": "90a494f8d4b61eb34d8566ecedd8ddd8fbf8b3f8d122c10ae64062c2ae1b46ec" + }, + "reviews/RENAME-PLAN-TEST-REVIEW.md": { + "bytes": 12790, + "sha256": "e2d94e73de3b4e66609b1c05f1692ebcb48c0b9d31553f1ed98f8b7f92397c1a" + }, + "reviews/inspect_rename_runtime.py": { + "bytes": 7468, + "sha256": "68e428c8959ab8a98a06ac240fc379c734646e38cbb2ca4cdec47a3672ad3c02" + }, + "reviews/rename_plan_bytes.py": { + "bytes": 4478, + "sha256": "d8ee2de75dacb68b88699710dd0e514571936c0a23654d3a36e00fb6fcf5e542" + } + } +} diff --git a/harness/experiments/analysis-mixed-rename-plan-20260924/rename_plan_bytes.py b/harness/experiments/analysis-mixed-rename-plan-20260924/rename_plan_bytes.py new file mode 100644 index 00000000..2d4ea5e4 --- /dev/null +++ b/harness/experiments/analysis-mixed-rename-plan-20260924/rename_plan_bytes.py @@ -0,0 +1,50 @@ +"""Independent literal/token arithmetic. Never imports or runs application code.""" +from pathlib import Path +import hashlib,json +ID=lambda n:f'00000000-0000-0000-0000-{n:012}' +def rich(sa=False): + prop,work,layer,extra=('sa_property','sa_function','layer Sa;',f'sa_system s "System" id "{ID(6)}" {{}}') if sa else ('oa_property','oa_activity','','') + main=f'arcadia 8;\nproject p "Project" id "{ID(1)}" {{\ninclude "b.arcadia"; include "a.arcadia";\nnode n id "{ID(4)}" {{ diagram @d; element @v; }}\n{prop} v "Value" id "{ID(3)}" {{ subject @w; type Number; base @f(y: 2, x: @g(x: 3, y: 4)) + @f(x: 5, y: 6); }}\n{work} w "Work" id "{ID(2)}" {{}}\ndiagram d "Diagram" id "{ID(5)}" {{ {layer} }}\n{extra}\n}}\n' + files=[] + for alias,name,n,op in [('f','F',10,'+'),('g','G',11,'-')]: + files.append(f'calculation {alias} "{name}" id "{ID(n)}" {{\ninput x id "{ID(1)}" : Number;\ninput y id "{ID(12)}" : Number;\nresult Number; body $x {op} $y;\n}}\n'.encode()) + return files+[main.encode()] +G=lambda n:f'G{n}' +P=lambda c,n:f'P{c}.{n}' +rows=[] +for file,c,alias in [(0,10,'f'),(1,11,'g')]: + rows += [(file,12,13,G(c),alias),(file,68,69,P(c,1),'x'),(file,128,129,P(c,12),'y'),(file,203,204,P(c,1),'x'),(file,208,209,P(c,12),'y')] +rows += [(2,a,a+1,t,s) for a,t,s in [(19,G(1),'p'),(122,G(4),'n'),(177,G(5),'d'),(189,G(3),'v'),(206,G(3),'v'),(269,G(2),'w'),(291,G(10),'f'),(293,P(10,12),'y'),(299,P(10,1),'x'),(303,G(11),'g'),(305,P(11,1),'x'),(311,P(11,12),'y'),(321,G(10),'f'),(323,P(10,1),'x'),(329,P(10,12),'y'),(350,G(2),'w'),(412,G(5),'d')]] +changed={G(1):'w',G(2):'p',G(3):'n',G(4):'v',G(5):'z',G(10):'g',G(11):'f',P(10,1):'y',P(10,12):'x',P(11,1):'y',P(11,12):'x'} +def check(files,edits,names): + assert len(edits)==len({(f,a,b) for f,a,b,_,_ in edits}) + assert set(t for _,_,_,t,_ in edits)==set(names) + totals=[] + for file,raw in enumerate(files): + subset=sorted(x for x in edits if x[0]==file);last=0;removed=added=0 + for _,a,b,target,spelling in subset: + assert a>=last and raw[a:b]==spelling.encode();last=b;removed+=b-a;added+=len(names[target].encode()) + totals.append((len(raw),removed,added,len(raw)-removed+added)) + return totals +for sa in (False,True): + files=rich(sa);r=rows+([(2,490,491,G(6),'s')] if sa else []);names=changed|({G(6):'u'} if sa else {}) + assert list(map(len,files))==[213,213,548 if sa else 474] + transformed=[b'// '+bytes.fromhex('e99ba8')+b'\r\n'+raw.replace(b'\n',b'\r\n') for raw in files] + tr=[(f,8+a+files[f][:a].count(b'\n'),8+b+files[f][:b].count(b'\n'),t,s) for f,a,b,t,s in r] + print('RICH', 'SA' if sa else 'OA','R',len(names),'M',len(r),'E',15,'Q',len(names),'files',check(files,r,names),'CRLF',check(transformed,tr,names)) + print('ORIGINAL',json.dumps(sorted(r)));print('TRANSFORMED',json.dumps(sorted(tr))) +category=Path(__file__).resolve().parents[1]/'as3batch/crates/oa-core/src/language/analysis_source/mixed/project/ordinary_index/tests/fixtures/categories.arcadia' +raw=category.read_bytes();assert len(raw)==2152 and hashlib.sha256(raw).hexdigest()=='3943579866157c7b5d95ce9edcb2d643058826b9af44257557e2864f130d15fc' +old=['p','a','child','implicit','s','link','d','note','t','q','sub','use','left','right','context'] +new=['a','p','implicit','child','link','s','note','d','q','t','use','sub','right','left','ctx'] +positions=[(19,1),(168,2),(249,3),(344,2),(369,4),(487,5),(561,6),(625,3),(640,4),(664,7),(741,6),(789,6),(818,8),(885,6),(925,9),(992,3),(1003,5),(1328,10),(1391,12),(1397,14),(1422,11),(1487,13),(1514,12),(1577,10),(1617,11),(1648,13),(1712,11),(1741,3),(1789,14),(1855,10),(1882,4),(1935,15),(2004,10),(2029,12),(2047,13),(2092,14)] +cr=[(0,a,a+len(old[n-1]),G(n),old[n-1]) for a,n in positions];cn={G(i+1):s for i,s in enumerate(new)} +print('CATEGORY R15 M36 E0 Q15',check([raw],cr,cn));print('CATEGORY',json.dumps(cr)) +files=rich();files[2]=files[2].replace(b'node n id',b'node '+b'n'*31+b' id') +size_rows=[(0,12,13,G(10),'f'),(2,122,153,G(4),'n'*31),(2,321,322,G(10),'f'),(2,351,352,G(10),'f')] +assert sum(map(len,files))==930 +for alias,want in [('renamed_f',924),('renamed_func',933)]: + totals=check(files,size_rows,{G(4):'n',G(10):alias}) + assert sum(t[3] for t in totals)==want + print('COMBINED SIZE',alias,totals,'total',want,'typed-only',930+3*(len(alias)-1)) +print('PASS: authored raw token positions and separate removed/replacement lengths only; no application pipeline/output or semantic acceptance.')