feat(review-tutor): add structure analysis core and endpoint - #67
Merged
Conversation
17 tasks
ElbertePlinio
force-pushed
the
feat/review-tutor-hardening
branch
from
August 24, 2026 20:47
551cb83 to
9576fb0
Compare
15 tasks
ElbertePlinio
force-pushed
the
feat/review-tutor-structure-core
branch
from
August 24, 2026 20:47
82ebb32 to
fc0764d
Compare
9 tasks
ElbertePlinio
force-pushed
the
feat/review-tutor-structure-core
branch
from
August 24, 2026 21:09
fc0764d to
22f5904
Compare
ElbertePlinio
force-pushed
the
feat/review-tutor-structure-core
branch
from
August 24, 2026 21:20
22f5904 to
39adf78
Compare
ElbertePlinio
changed the base branch from
feat/review-tutor-hardening
to
main
August 24, 2026 21:29
ElbertePlinio
force-pushed
the
feat/review-tutor-structure-core
branch
2 times, most recently
from
August 24, 2026 21:30
b2dfb4d to
497c5fa
Compare
This was referenced Aug 24, 2026
Parse the input diff without the DOM, track renames, analyze TypeScript and JavaScript connections lexically with bounded exact evidence, and serve a deterministic, cached, honestly partial structure snapshot from an authenticated local route.
ElbertePlinio
force-pushed
the
feat/review-tutor-structure-core
branch
from
August 25, 2026 19:09
497c5fa to
73f7e7e
Compare
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.
Refs #62 — PR 1 of 4 (comparison provenance and analysis core). Stacked on #66 (base
feat/review-tutor-hardening); part of the batched Review Tutor chain #65 → #66 → this → later #62 slices. No UI in this slice.What changed
src/structure.ts(new): DOM-free unified diff parser with rename/copy/binary/mode handling, a lexical (non-executing) TypeScript/JavaScript connection analyzer (static import, re-export,require, dynamicimport, side-effect imports; explicit type-only detection), comment/string/regex masking so no edge can come from a literal, candidate-path resolution (.js→.ts, extensionless, index, modern extensions), and deterministic snapshot assembly.STRUCTURE_LIMITSinsrc/protocol.ts.rt/1untouched (server-generated payload). Edge status includesmodifiedfor binding-only changes to an existing import (one edge, both evidence lines — never a green+rose pair).comparison.from/toencode the source-fidelity table explicitly; PR sources are patch-only partial and nothing is fetched.GET /api/structurebehind the existing bearer/Host/Origin gate, cached per input snapshot, 409 typed error without an input.truncated: true.Tested
modifiedcollapse, all source kinds' comparison endpoints, every cap, byte-identical determinism, route auth 401 / 409 / cache invalidation on source switch.bun run check: see the CI run; local coverage 81.1% statements (structure.ts 96.5%).Not tested
Risks
Local review: serious-backend class — three independent reviewers (correctness, security/resource limits, tests/conformance), two targeted fix-verification rounds (three reviewed HEADs, the review ceiling). Disclosure for the human reviewer: the final verification found one remaining P2 (a keyword used as a member name, e.g.
obj.return / 2, was misread as a regex opener and hid a real import on the same line). Its fix is the last two-line guard inopensRegexplus the test "treats a keyword-named member before a slash as division"; it was validated by the full gate but not independently re-reviewed. Not release-note-worthy (platform packages repo).Human gate: stops at ready for human review; merge only on Elberte's authorization.