Repository navigation
Description
Summary
Dockerfile is not in _CLASS_START_NAMED_EXTRACTION_LANGS (gitgalaxy/core/detector.py:369), so
it gets the legacy fallback regex (class|struct|interface|trait|enum) for named-class
extraction -- which never matches Dockerfile's FROM syntax at all, correctly, since Dockerfile
has no such keywords. The practical result: class_data stays completely empty for every
Dockerfile scanned (confirmed: 0 rows across all 4 files in
language-crucible/data/dockerfile/moby/test_targets/, despite real multi-stage builds with up
to 69 real FROM ... AS <stage> build stages in one file).
This is a real, missing feature, not a bug in an existing implementation -- filed separately from
#1972 (which is about file_data.class_count wrongly reporting a phantom number even though this
gap exists) because implementing it requires a regex change, not just a data-source swap.
Why simply adding "dockerfile" to the allowlist isn't enough
Dockerfile's own class_start rule (language_standards.py):
"class_start": re.compile(r"^[ \t]*(FROM)(?=[ \t]|\\[ \t]*(?:\r?\n|$))", re.M | re.I),Group 1 captures the literal keyword FROM, not the build stage's actual name/alias (the
AS <name> suffix, e.g. FROM golang:1.25 AS base -> real name is base, GitGalaxy's own
"class wrapper" framing per the rule's own comment). Every real Dockerfile class instance would
need to resolve to the SAME literal string "FROM" if the allowlist were added today without
also changing the regex to capture the AS <name> alias (falling back to the base image name,
e.g. golang:1.25, for a stage with no alias -- the final/default stage).
Suggested fix
- Extend
class_start's regex to capture the stage alias when present
(FROM <image>(?:\s+AS\s+(\S+))?), landing the name in a group the same way other languages'
class_startrules already do. - Add
dockerfileto_CLASS_START_NAMED_EXTRACTION_LANGS. - Decide the boundary-resolution path: dockerfile stages are never nested (mirrors ABAP's own
#1907precedent -- flat "next class match, or EOF" is always correct, no brace/indent
scoping needed). - Verify against
_CLASS_START_REQUIRES_BODY_ANCHORgating (dockerfile should NOT be added
there -- aFROMline has no body-anchor concept the way c's forward-declaration check does).
Full verification chain required (extraction gauntlet + strict tests, ruff/mypy audits,
crucible_check.py against the full corpus, both golden masters re-blessed) since this is a
language_standards.py + detector.py change, same as any other parsing-logic PR.
Activity
Fix dockerfile func_start recall: route to Mode A, not brace search (#…
Fix file_data.class_count to use the real named class list (#1980)
Regenerate tri-comparison chart after dockerfile sweep fixes land (#1997