Repository navigation
Per-unit is_public / is_documented on function_data; reflection stays state_heat_triggers (#2908 Phase 2) - #2935
Merged
Conversation
…ection stays state_heat_triggers (#2908 Phase 2) - detector.py computes is_public as the union of the api-header name match (A) and the export-list name set (B, new _export_declared_names sibling of _export_declaration_offsets); galaxyscope.py's Contextual Baseline Fix ORs in the healed-orphan credit (C) before the usage_status flip, inside the same "credit actually fires" branch, so it lands in the DB (record_mission runs in Phase 12, strictly after Phase 3's _calculate_risk_exposures both across phases and within the same per-file loop iteration that appends to self.parsed_files). - is_documented is a NEW positional doc-rule pass: prism.py's split_positional_comment_stream builds a line-number-aligned, code-blanked/ comment-preserved counterpart of code_stream (mirroring split_streams' construction with roles swapped), and detector.py anchors each doc-rule match's end line to a unit's header window (k=5 above, +2 into the body for the docstring-position family only). comment_analysis, its counts, def_doc and the slicer's docstring field are all untouched. - Persists two new function_data columns (auto-healing ALTER TABLE migration) and three new "5. Function Analysis" audit JSON keys (Is Public / Is Documented / Reflection Hits); both golden masters regenerated columns-only (2075 diffs, all inside existing Function Analysis entries, zero signal/score values moved -- verified via a full structural JSON diff, not just the printed sample). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSfBNJvqMah9CsZDN15sEd
…erl and powershell comment families (#2908 Phase 2) - prism.py: _positional_nested_comments (recursive_block: rust/scala/swift; recursive_block_haskell: haskell; recursive_block_lisp: scheme) peels nested block comments from a byte-offset-aligned masked view so a found delimiter's span can be sliced straight out of the pristine original text, instead of _strip_nested_comments' own variable-length placeholder masking (fine for line-count-only correspondence, unsafe for this method's byte-offset slicing). - prism.py: _positional_perl_comments makes POD blocks (=pod/=headN/.../=cut) visible verbatim at their real lines -- perl.py's own "Known remaining gap, not fixed here" note confirms POD was never stripped into comment_stream by the production pipeline, so comment_analysis's doc count already reads 0 for POD-documented perl files; that gap is untouched, this only opens a path for the NEW positional pass to see it. `#` line comments now also carry perl's own bare-regex/quote-like-operator masking (duplicated from the private _mask_perl_line closure), so a `/regex#with-hash/` literal's embedded `#` isn't misread as opening a comment. powershell/embedded_syntax needed no change -- it was never excluded from the generic REGEX_MATRIX positional path; jcl stays blank correctly (no `doc` rule exists for it). - Golden masters regenerated columns-only again: 962 diffs each leg, every one an existing "Is Documented" 0->1 flip inside rust/scala/swift/haskell/ perl entries (verified via full structural JSON diff), zero other keys/values moved. crucible_check both legs PASS; bless_scope leaf-key table still shows only 5. Function Analysis. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSfBNJvqMah9CsZDN15sEd
…t blocks (#2908 Phase 2) - Root cause was NOT in prism.py's embedded_syntax routing (verified correct for both `<# ... #>` and `#`-line doc-block shapes). The real gap: the file-level `doc` equation `comment_analysis` feeds was already the sum of TWO passes -- comment_analysis over comment_stream, AND coding_analysis's own generic per-rule loop, which runs every rule (including `doc`) against every segment of code_stream too, with no comment-vs-code distinction. Confirmed on keyword-rosetta's powershell main.ps1 (expected_signals.json: "doc": 1): its `.SYNOPSIS` plant carries no `#`/`<#`/`#>` delimiter at all, so comment_stream never contains it, yet the file's own doc equation already read 1 -- entirely from the code_stream pass. A positional pass that only ever scanned the comment surface (positional_comment_stream) structurally could never agree with the file-level count it's the per-unit form of. - detector.py's splice() now also scans code_stream (already line-aligned with the original file for the same reason positional_comment_stream is) for `doc`-rule matches, merging both streams' match end-lines into one window-checked set. No new prism.py stream was needed. - Strengthened the powershell contract test to mirror the real corpus shape (bare, undelimited `.SYNOPSIS` inside code, not a `<# #>` block) plus a negative at 6+ lines -- the old block-shaped test is kept alongside it (still a real, valid shape) since it wasn't wrong, just incomplete. - This is a general fix, not powershell-specific: the golden master diff also touches shell/assembly/cobol/rust/python entries wherever their own `doc` rule already matched code-stream text (the crucible corpus's pre-existing `doc` equation counts already included these; is_documented now agrees with them). Verified no a/b/c corpus file's public/documented invariant moved for any of the 9 languages checked (python/c/cobol/rust/ haskell/perl/powershell/shell/assembly), and the structural JSON diff against both prior golden masters shows every changed leaf is an existing "Is Documented" 0->1 flip, nothing else. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSfBNJvqMah9CsZDN15sEd
…se 2) Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XSfBNJvqMah9CsZDN15sEd
7 of 11 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2908 (Phase 2 · per-unit attributes). Additive only: every extracted unit gains
is_public(api-header name match ∪ export-list names ∪ healed-orphan credit, per D2) andis_documented(adoc-rule match anchored to the unit's header window: k=5 lines above, +2 into the body for the docstring-position family, per D3);reflection_hitsis the existing per-unitstate_heat_triggerscolumn, exposed in the audit JSON rather than duplicated. Two newfunction_datacolumns (auto-healing migration), three new5. Function Analysisaudit-JSON keys. No count, signal, or score moves.Score-contract gauntlet (contract_pr_check)
Measured
Corpus
Golden masters
6. Parsed Files → 5. Function Analysis(the three new keys); bless_scope showed no signal/score leaf key in any roundTests
///, haskell, scheme, perl POD, powershell) + the undelimited-doc-marker caseWhat the sweep surfaced (fixed here, not ledgered)
recursive_block/recursive_block_haskell/recursive_block_lisp, perl and powershell —is_documentedcould structurally never fire for 7 languages (commit 2)doc-rule matches can live in the code stream (undelimited markers like a bare.SYNOPSIS); the anchor now merges comment-stream and code-stream match end-lines (commit 3)Corpus (engine-first merge order)
squid-protocol/keyword-rosetta
rebless/2908-p2-unit-keys(opens as its own PR):verify_language.pyaggregatesunits_public/units_documentedfromfunction_data; all 46 manifests gain the keys; 7 main doc plants relocated count-neutrally into the anchor window; exception classes ledgered (units-public-main-outside-api-contract,units-documented-structural-absences). 46/46 PASS.Pre-existing defects found and filed (not touched here)
entry :: IO ())🤖 Generated with Claude Code
https://claude.ai/code/session_01XSfBNJvqMah9CsZDN15sEd