feat(core): scanner -- structural analysis and anagild snapshot export #107
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type/architecture
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
type/task
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/fragjan#107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Add a structural scanner to fragjan core that reads source files
and writes
.anagildsnapshot files for consumption by anagild.The scanner is a core component -- not a primitive. Primitives may
use it to gain structural context (e.g. function boundaries for
return analysis). fragjan remains fully independent of anagild;
the
.anagildfiles are optional output.Background
fragjan already reads all files for rule checking. The scanner
adds structural understanding on top: functions, returns, requires,
variables, and
-- anagild:annotations.Format specification: DAW/anagild docs/anagild-snapshot-format.md
(schema: anagild_snapshot/v1)
Scope
New file:
core/scanner/init.luaResponsibilities:
-- anagild:annotations with target association.anagild/<path>.anagild(current snapshot).anagild/<path>.anagild.history(hash reference list).anagild/<path>.anagild.history.<sha256>(snapshot archive)Out of scope (later):
Output format
See DAW/anagild docs/anagild-snapshot-format.md for the full schema.
Key fields per snapshot:
schema:anagild_snapshot/v1lang: detected languagehash: sha256 of source file (algorithm + value)functions[]: name, range, params, returns with kindrequires[]: module, alias, linevariables[]: name, scope, line, kindannotations[]: line, target_kind, target, text, confidencereturn.kind values
success_return-- recognized success patherror_return-- recognized error pathbare_nil-- single nil without second return valueunknown-- return recognized, meaning not determined (+ optional confidence)Language support (v1)
Initial implementation covers
luaonly.Scanner interface must accept a
langparameter to allow futureextension (c, shell, markdown, yaml, json) without API changes.
Acceptance criteria
core/scanner/init.luaexists and is loadable-- anagild:annotations extracted and associated to nearest element.anagild/directory structure mirrors repo tree.anagild/being writable (optional output)Notes
The scanner must not affect fragjan's existing pass/fail behavior.
If
.anagild/is not writable, fragjan logs a warning and continues.No new rule packs or primitives in this issue -- scanner only.
Enables: DAW/fragjan#93 (nil-err semantic check)