Skip to content

derived_from_description leaks into artifacts that declare no provenance #94

Description

@dieterbaier

Problem

derived_from_description is set as an AsciiDoc attribute by each artifact's
generated attributes fragment and is never unset. AsciiDoc attributes persist
for the rest of the document once defined, so every artifact rendered after
one that carries provenance inherits it.

Artifacts guard their provenance block with ifdef::derived_from_description[],
which is exactly the condition that stays true. The guard therefore fires for
artifacts that have no derived_from metadata at all, and prints someone
else's origin under their own Derived from heading.

Evidence

In the rendered build/architecture/index.html, under the Derived from
heading of two artifacts that declare no derived_from in their front matter:

Artifact Renders
QS-004-ai-suggestion-reviewability ADR-008's provenance text
R-001-ai-suggestions-as-truth ADR-008's provenance text

Both should render nothing. Neither has a derived_from key.

This is not new: on main the same two artifacts display ADR-007's provenance
instead, because ADR-007 was the last artifact with provenance rendered before
them. Adding an artifact with derived_from does not create the defect, it
changes which text leaks and where the leak starts.

Cause

scripts/validate-metamodel.rb writes :derived_from_description: into
generated/<anchor>-attributes.adoc for artifacts that have provenance, and
writes no counterpart for artifacts that do not. A fragment that does not set
the attribute also does not clear it.

Candidate fixes

  • Have every artifact's attributes fragment unset the attribute when the
    artifact has no provenance (:!derived_from_description:), so each fragment
    leaves the document in a known state rather than depending on what ran before
    it. This is the smallest change and makes the fragments self-contained.
  • Or scope the provenance rendering so it cannot depend on document order at
    all.

Prefer whichever keeps the fragments independent of their include position;
order-dependence is what made this invisible for so long.

Behaviour specification

features/documentation-generation.feature specifies that metadata is exposed
as attributes; it does not specify that a fragment clears what it does not set.
That is the gap. bdd-specification applies: add a scenario for an artifact
without provenance rendered after one with provenance, asserting that no
Derived from text appears, and bridge it into the existing tests.

Acceptance criteria

  • An artifact without derived_from renders no provenance, whatever
    precedes it in the assembled document.
  • An artifact with derived_from still renders its own.
  • A scenario covers the leak case and is bridged to a test.
  • QS-004 and R-001 render no Derived from text in the built HTML.
  • Existing generator tests keep passing.

Origin

Found on 2026-09-04 by an independent Convergence Check on #88, and confirmed
in the rendered output for both branch and main.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority:p2Cheap fixes backed by real usage evidence

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions