Repository navigation
Conversation
inspect_managed_members decoded ECMA-335 Constant rows only for fields. A Param row with HasDefault had no value anywhere in the result, and the limitation said parameter and property defaults were not decoded. The field reader becomes the inspection's single Constant-table owner (ManagedConstants.ts): it indexes Field and Param parents once, and fields and methods share it. Each selected method now reports parameter_defaults: the Param rows of its ParamList run that declare HasDefault or own a Constant row, with token, row offset, sequence, name, flags and the same constant record. An empty list means the run was examined; null means the run cannot be attributed (out-of-range coordinate, a run that ends before it starts or is out of order with another nonempty run, or an invalid ParamPtr table), with an issue and partial coverage. ParamPtr positions resolve through the existing member pointer owner. ParamList coordinates are read without per-row cursor bookkeeping, so selected inspections are not charged for unselected MethodDef rows. Out-of-order runs stay unknown instead of being rescanned, which keeps examined Param positions bounded by the Param list when malformed coordinates alternate. managedFieldConstantSchema is renamed managedConstantSchema. The limitation now names only property defaults and enum-name mappings, member comparison discloses that parameter defaults are not compared, the managed guide documents the field, and the managed PE fixture builder can emit Param and ParamPtr rows and per-method signatures. Validation: the new ManagedParameterDefaults tests fail on the base (12 of 14; the two passing ones are negative guards) and pass with the change; all src/dotnet source tests with the member view and output-schema contract tests (677), the MCP constants boundary test and both managed comparison boundary tests pass; npm run check:fast and npm run docs:check pass. Refs morluto#5150
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no blocking issue remains. SummaryExposes parameter defaults through the same
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
C["Constant table"] --> I["Shared declaration index"]
F["Selected fields"] --> I
M["MethodDef ParamList"] --> R["Check parameter ownership"]
P["ParamPtr, when present"] --> R
R --> D["Selected parameter defaults"]
D --> I
I --> E["Retained member Evidence"]
E --> V["Field and method pages"]
Reviews (20) · Last reviewed commit: "refactor(dotnet): read retained Param ro..." · Reviewed by Greptile |
…wner Review follow-up for parameter defaults. With a ParamPtr table, a method owns the Param rows its pointer positions name. A Param row that no pointer lists has no owning run. If that row declares a default, it could belong to any method, yet every method reported an empty, complete defaults list. The member-pointer owner now keeps its validated positions with the lookup and answers whether a definition row is listed without throwing per row. The default reader checks unlisted rows once and reports every method's defaults as unknown, with one invalid-row issue, when an unlisted row declares a default. Unlisted rows without a default do not change the result. One unreadable Param row, such as an invalid #Strings name index, no longer drops the defaults already read and skips later ones. Each row is read in isolation, and its failure is reported as a parse issue. The PE fixture computes ParamList starts with a running counter instead of rescanning earlier methods, and accepts a raw Param name index. Tests: the unlisted-default and unreadable-name cases fail before this change and pass after. src/dotnet and managed domain tests pass (615), as do 36 managed boundary test files (410). check:fast passes.
Current main counts raw Buffer and DataView reads against baselines that can only shrink, and merged with main this branch failed them: - ManagedParameterDefaults.ts was new, with four reads. - readMethodParamList and memberListDefinitionRow each added two. - The renamed ManagedConstants.ts carried the read baselined under ManagedFieldConstants.ts. Param rows, ParamList coordinates and pointer positions are now read through the checked BinaryReader. Layout admission still bounds every row. A retained default reserves its row bookkeeping as its cursor did, and rows without a default are still neither retained nor charged. The renamed file keeps its single existing read under its new path. Tests: src/dotnet and managed domain tests (607) and 36 managed boundary test files (410) pass. architecture-guards, format:check and check:ci:fast pass on the branch merged with main.
Davmunrey
left a comment
There was a problem hiding this comment.
Status since opening:
- Greptile findings fixed in fa7e2ee:
- a default on a Param row that no ParamPtr row lists keeps every method's defaults unknown;
- one unreadable Param name no longer hides sibling defaults;
- the fixture counter is linear.
- Merged current main in 0d46ae3. To pass main's raw-read guard, 821eeb5 reads Param rows, ParamList coordinates and pointer positions through
BinaryReader. The renamedManagedConstants.tskeeps its one baselined read. - Validation on the merged branch: dotnet and managed tests (607), managed boundary tests (410), architecture-guards, format:check and check:ci:fast.
- Related design question about that guard and the checked metadata cursor: #10688.
morluto#10952 made managed Evidence fields required where they were defaulted only for historical Evidence. parameter_defaults follows the same rule: it is required and nullable, the historical-omission sentence is gone from the schema and the guide, the member-comparison disclosure reads the field directly, the workflow example writes an empty list, and the historical-omission test now checks that a member record without the field is refused.
Review follow-up for parameter defaults. Without ParamPtr, a first ParamList start of 2 leaves Param row 1 outside every method's run. A default on that row had no owning method, yet every method reported a complete list. Ownership is now checked through method runs as well as pointer membership. Positions before the smallest valid ParamList start are scanned once with the unlisted ParamPtr rows, and a default on any of them keeps every method's defaults unknown with one invalid-row issue naming the reason. A leading row without a default changes nothing. Adds the feature record under docs/specs/managed/parameter-constant-defaults (spec, plan, tasks) and indexes it, and updates the guide and schema description for the unowned-row case. Tests: the leading-default case fails before this change and passes after; a leading row without a default stays complete. Managed and contract tests (1003) and managed boundary tests pass. architecture-guards, check:ci:fast and docs:check pass.
Main keeps each counted guard's baseline in scripts/verify/baselines/<guard>.json and moved BinaryReader to src/domain/binaryContainer. The branch's raw-buffer-read count follows its rename of ManagedFieldConstants.ts to ManagedConstants.ts (still 1), and its three readers import BinaryReader from the new module.
# Conflicts: # src/domain/managed/managedMemberPointers.ts # src/dotnet/ManagedConstantValue.ts # src/dotnet/ManagedFieldConstantsBudget.test.ts # src/dotnet/ManagedMemberRows.ts # src/dotnet/ManagedMethodDefinitionRows.ts
# Conflicts: # src/domain/managed/managedArtifact.ts
# Conflicts: # scripts/fixtures/managed/pe.mjs
|
The CI failure on 6c66908 came from main, not this branch. The Source tests job failed in 4 files (cliBundleResource, directAnalysisFactories, evidenceSubject, KernelBuildConfigService; 11 tests). Each fails the same way on main 2430b08 alone and passes on main 42cab26. 3c8fc14 merges main 42cab26. The only conflict was scripts/fixtures/managed/pe.mjs, which #11609 typed with JSDoc. The Param rows, ParamPtr rows, per-method signature and ParamList from this branch now follow that style, and the script type check passes. Earlier merges: 66a0889 (072b578, the .NET readers moved to src/domain/managed in #11544) and 6c66908 (2430b08). On the merged tree, those 4 files pass. So do the managed unit tests (628) and the managed boundary tests (187), along with architecture-guards, check:ci:fast and docs:check. |
… presence The unowned-row scan cached its result with ??=, so a clean scan (null) ran again for every selected method: the work grew with methods times Param rows instead of methods plus rows. The scan also called the Constant reader on each unowned row only to learn whether a default exists, and that reader decodes and charges the whole value. A large blob on an unowned row could exhaust the shared decode budget before the row was reported, dropping facts already read. The Constant owner now answers declares() from the row flags and its declaration index without reading the blob, the scan uses it, and a clean scan is cached. Tests count the scan's checks across two methods and report an unowned default with less than one KiB of budget left.
# Conflicts: # scripts/fixtures/managed/pe.d.mts
# Conflicts: # docs/guides/managed/managed-code-analysis.md # docs/specs/README.md # scripts/verify/baselines/raw-buffer-read.json
Main's #Strings reader no longer takes the heap size; pass the three arguments it reads.
# Conflicts: # src/domain/managed/managedArtifact.ts # src/dotnet/ManagedConstantValue.ts # src/dotnet/ManagedMemberRows.ts # src/dotnet/ManagedMethodDefinitionRows.ts
# Conflicts: # docs/specs/README.md
Main moved planning records out of the repository in morluto#12856, so this branch drops its docs/specs/managed/parameter-constant-defaults files and the docs/specs/README.md entry; the design lives in the PR description.
Main split field and method decoding into decodeFieldRow and decodeMethodRow with per-call contexts (morluto#13317) and rewrote the field constant budget test (morluto#13365). Carry the parameter defaults onto that shape: the inspection's shared Constant reader goes into parseFields and parseMethods, the field context calls it with the Field table, and the method context holds the Param default reader so both the full scan and the selected-interval path report parameter_defaults. The budget test now calls the shared reader with the Field table.
|
Merged main again after #13317 and #13365 split field and method decoding into decodeFieldRow/decodeMethodRow. The shared Constant reader now goes through those contexts, so both the full scan and the selected-interval path report parameter_defaults. Following #12856 the branch no longer adds docs/specs files; the design is in the PR description. Typecheck, build, 857 tests across src/dotnet, src/domain/managed and the managed MCP/provider boundaries, and docs:check pass, and the branch merges cleanly with main 64d42d2. |
|
@Davmunrey thanks for the PR — there are 2 open review threads here:
Could you address or reply to these? Once they're resolved and CI is green we can take another look. |
Main replaced the hand-written append in the field constant index with appendToMapList (morluto#14548). The branch keeps that index in ManagedConstants.ts keyed by the parent token, so it uses the helper with the token key.
…dable parameter_defaults was a required method field, so retained managed-members Evidence saved by an earlier REA version, whose methods lack it, no longer parsed. The field is now exact-optional: every inspection still reports it, older Evidence loads and pages as before with no parameter-default facts, and member comparison treats a missing field like an empty one. The guide says so.
…cans readMethodParamList and memberListDefinitionRow allocated a BinaryReader for every MethodDef coordinate and every pointer position. managedMetadataReader caches one reader per artifact buffer, as the tool-design guide asks, and metadataIndexAt reads a 2- or 4-byte index with it for scans that do not retain the rows they examine.
The Param reader decoded Flags, Sequence and Name with its own offsets and index width and charged the row budget by hand, repeating what metadataRowCursor owns for retained metadata rows. Rows that declare a default are now read through the cursor, which checks each column against the admitted row and charges the row once. Rows without one still read only their Flags column, through the shared managed reader, and are neither retained nor charged.
|
Thanks @morluto. Both threads are addressed, plus Greptile's new P2:
Typecheck, build, 871 tests across src/dotnet, src/domain/managed and the managed MCP/provider boundaries, module boundaries, architecture guards and docs:check pass, and the branch merges cleanly with main e8b2578. |
Summary
Fixes #5150. Field defaults landed in #8015. Each selected method now reports
parameter_defaults, decoded by the same ECMA-335Constantowner that fields use.Change and scope
ManagedFieldConstants.tsbecomesManagedConstants.ts. It builds one declaration index forFieldandParamparents and reads eachHasDefaultflag correctly (fields0x8000, params0x1000).ManagedParameterDefaults.tsattributesParamListruns as II.22.26 specifies, includingParamPtr.parameter_defaultscan take three forms:[]: examined, no defaults;null: unattributable run, with an issue reported;unavailablewith a limitation.Evidence and regression coverage
ManagedParameterDefaults.test.ts: 12 of 14 failed on the base (the other 2 are negative guards). All pass after the change.parameter_defaultsfrom retained Evidence.Validation performed
npm run test:localon the dotnet suite: 677 passed.npm run docs:checkandnpm run check:fastpassed.Author readiness
Human owner: @Davmunrey
Before merge
type(scope): outcome.