Skip to content

fix(bundle): reconcile artifactPlanForScope with the canonical artifact selection #115

Description

@lamemustafa

artifactPlanForScope in src/background/filed-returns-single-period-bundle-ledger.ts
is the last independent expansion of the GSTR-2B artifact set after #110
consolidated the rest onto concreteFiledReturnsArtifactTypesForSelection.

return scope.returnType === "GSTR-2B" ? ["PDF", "EXCEL", "JSON"] : ["PDF", "EXCEL"];

It was left alone deliberately, because it is not the same rule. The canonical
helper returns the triplet only for a GSTR-2B all-formats selection; this
returns it for any GSTR-2B scope, and returns ["PDF", "EXCEL"] for every other
return type regardless of what was selected. Replacing it with the helper would
change behaviour for a GSTR-2B single-artifact scope, which is outside what #110
set out to do.

Why it still matters

The finding behind #110 was that evidence and runtime could require different
artifact sets. This is the one place that divergence can still originate, and it
is the harder kind: not a stale copy of the same rule, but a different rule
sitting where the canonical one is now used everywhere else. A future reader
consolidating "the last duplicate" without checking the semantics would silently
change bundle planning.

What to decide

Establish which behaviour is correct for a GSTR-2B single-artifact bundle plan,
then either use the canonical helper or rename this to state the different rule
it encodes and why. If the broader behaviour is intentional, it deserves a name
that says so and a test pinning it, rather than looking like an un-migrated
duplicate.

Needs live evidence before changing: bundle planning decides which artifacts a
selected-file ZIP expects, so a behaviour change here alters what counts as a
complete bundle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions