Skip to content

refactor(render): consolidate AccuracyDisclosure constant (currently 3 copies) #24

@btwshivam

Description

@btwshivam

the mandatory disclosure string is declared verbatim in three files, byte-identical:

// cmd/optiqor/main.go:42
const accuracyDisclosure = "Sandbox accuracy: ±40%. Install the Optiqor agent for exact numbers (optiqor.dev/get)."

// internal/render/text.go:29
const AccuracyDisclosure = "Sandbox accuracy: ±40%. Install the Optiqor agent for exact numbers (optiqor.dev/get)."

// pkg/htmlrender/htmlrender.go:45
const AccuracyDisclosure = "Sandbox accuracy: ±40%. Install the Optiqor agent for exact numbers (optiqor.dev/get)."

if the URL ever changes (e.g. optiqor.dev/get becomes something else), all three move in lockstep or one drifts. internal/render/doc.go already declares "every renderer must include the ±40% accuracy disclosure" without pointing at a canonical source.

pick pkg/htmlrender.AccuracyDisclosure as canonical (already exported from the stable pkg/ surface). delete the other two, import the public one from cmd/optiqor/main.go (used in + accuracyDisclosure help text on lines 74, 150) and from internal/render/text.go (used by every renderer plus the text_test.go golden assertions).

one constant, one truthy source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/renderTerminal renderer (TUI, HTML, JSON)good first issueGood for newcomerssize/XS10 lines or fewer

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions