Skip to content

Astro: frontmatter fails at line 1 (partial extraction), and the warning hardcodes closed Kotlin issue #2551 for every language #2788

Description

@sortakool

Summary

Two related problems, observed on 0.9.44.

  1. The Astro extractor fails at line 1 on an ordinary --- frontmatter
    block, so the file is only partially extracted.
  2. The warning that reports it hardcodes (#2551) for every language, and
    Kotlin: bundled grammar rejects one-line type bodies (class C { val v = 1 }) — 21/541 files partially extracted, exit 0, no warning #2551 is a closed, Kotlin-specific issue. Anyone who follows the pointer
    lands on a resolved problem that has nothing to do with their file.

1. Astro frontmatter fails at line 1

warning: 1 file(s) had syntax errors and may be partially extracted:
  website/src/pages/index.astro (first error at line 1) (#2551)

The file opens with the standard Astro component-script fence:

---
const GITHUB_URL = "https://github.com/adihebbalae/Attacca";
const BRANCH = "master";

const plugins = [
  { name: "attacca-core", tagline: "Workflow skills" },
  ...
];
---

Line 1 is the opening ---, which is the most basic construct the format has,
so this does not look like an edge case in the grammar.

Source: Attacca at website/src/pages/index.astro.

2. The warning misdirects every reader

extract.py:5636 (0.9.44):

f"may be partially extracted: {_shown}{_more} (#2551)",

(#2551) is a literal in the shared message, emitted regardless of language.
The surrounding comments already know this — line 5619 refers to "the genuine
#2551 Kotlin one-line-body"
case — but the reference is still attached to all
of them.

The cost is concrete: the citation is the only lead the message offers, and it
sends the reader to a closed Kotlin issue. We initially recorded this astro
failure as "already tracked upstream" on the strength of that number, and only
found otherwise by opening it.

Suggestion: drop the hardcoded number, or make it language-aware, or point at a
stable docs page about partial extraction instead of a single issue.

Why partial extraction deserves a loud signal

"May be partially extracted" means an unknown number of nodes are missing from
the graph, and the run still exits 0. For a knowledge graph that is silent data
loss, and a consumer cannot tell a sparse file from a truncated one. A count of
what was dropped, even approximate, would make it actionable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions