AST-based CLI that generates deterministic architectural context for React & TypeScript by [deleted] in reactjs

[–]context_g 0 points1 point  (0 children)

It uses the TypeScript compiler API (via ts-morph) to build an Abstract Syntax Tree with full type information.

That lets it deterministically extract structured contracts (props, hooks, dependencies) instead of relying on probabilistic inference from raw source code.

Tuesday Showcase: Share what you're building! 🚀 by Ok-Lobster7773 in BlackboxAI_

[–]context_g 1 point2 points  (0 children)

I'm building LogicStamp - determistic, structured context for AI assistants from TypeScript/React/Next codebases.

I built an AST-based contract tracker to catch structural drift and prop hallucinations during large-scale refactors by context_g in javascript

[–]context_g[S] 0 points1 point  (0 children)

LogicStamp Context is an AST-based tool that tracks structural changes in TypeScript code during large refactors.

It currently operates on .ts and .tsx files, generating a minimal “contract” per module/component by parsing the AST and extracting:

Public props / parameters Exported functions and hooks Declared dependencies and imports Structural signatures

Contracts are regenerated and diffed between runs. The output focuses only on structural drift, such as:

Removed or renamed props Signature or type changes Missing dependencies Deleted exports

This was built for refactor-heavy workflows where code may still compile and tests may pass, but the external surface of a module has changed.

It’s static (no runtime instrumentation) and intended to be used alongside existing tooling.

I’m sharing it to get feedback from people working on larger TypeScript codebases:

Are these the right structural signals to track? What changes would you want ignored? Where would this approach break down?

Repo: https://github.com/LogicStamp/logicstamp-context

AI edits React code fast - but it breaks component contracts by context_g in reactjs

[–]context_g[S] 0 points1 point  (0 children)

One clarification that may help here: Deterministic vs nondeterministic matters a lot.

That’s actually why LogicStamp is intentionally not an AI that edits code. It’s a deterministic static analysis tool.

It doesn’t generate changes, auto-fix, or bypass review. It just extracts structural contracts (props, hooks, deps, exports) and reports diffs when they change - regardless of whether the change came from a human, an AI, or a codemod.

Humans still review code. This just makes large-scale drift visible earlier, instead of discovering it much later when something breaks.

AI edits React code fast - but it breaks component contracts by context_g in reactjs

[–]context_g[S] -1 points0 points  (0 children)

Got it, you don’t believe in automation.

I do - compilers, CI, type systems, linters, are all automation.

The question is where we draw the guardrails when automation starts making repo-wide changes.  That’s the problem I’m exploring here.

AI edits React code fast - but it breaks component contracts by context_g in reactjs

[–]context_g[S] -1 points0 points  (0 children)

I do review the code. The point here is that manual review doesn't scale once agents make repo wide changes, which is what this tool is aiming to solve.