You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the actual parser for .gittensory-miner.yml (the MinerGoalSpec), consuming the schema documented in the companion schema-doc issue. Pure, deterministic, no IO — mirrors parseFocusManifest's malformed-input-degrades-to-safe-defaults behavior in src/signals/focus-manifest.ts exactly: a broken or missing .gittensory-miner.yml must never throw, it must degrade to an empty/neutral spec with a warning.
Deliverables
packages/gittensory-engine/lib/miner-goal-spec.ts — export type MinerGoalSpec (fields per the schema-doc issue: preferredLanes, blockedPaths, maxFilesChanged, maxLoc, freshnessDays, avoidLabels, present: boolean, warnings: string[]) and export function parseMinerGoalSpec(raw: unknown): MinerGoalSpec, following the exact malformed-input-degrades pattern of parseFocusManifest (src/signals/focus-manifest.ts:995) — non-object input, array input, and unknown-field input all degrade to a safe empty spec with a warning pushed, never a thrown error.
export function parseMinerGoalSpecContent(content: string | null | undefined): MinerGoalSpec — the YAML/JSON string-content wrapper, mirroring parseFocusManifestContent (src/signals/focus-manifest.ts:1043): empty/null content also degrades to the empty spec, not an exception.
Unit tests covering: a fully-populated valid spec, a missing file (empty content), a malformed (non-mapping) raw value, and each individual field's out-of-range / wrong-type value degrading independently (mirrors the per-field warning tests already used for parseFocusManifest).
Export MinerGoalSpec and both parse functions from packages/gittensory-engine/lib/index.ts so packages/gittensory-miner can import them from @jsonbored/gittensory-engine.
References
src/signals/focus-manifest.ts lines 995-1043 (parseFocusManifest, parseFocusManifestContent) — the exact degrade-on-malformed-input pattern to mirror
.gittensory-miner.yml.example (from the companion schema-doc issue) — the fixture shape to parse
packages/gittensory-engine/lib/index.ts (from the engine-scaffold issue) — where these exports land
Implement the actual parser for
.gittensory-miner.yml(the MinerGoalSpec), consuming the schema documented in the companion schema-doc issue. Pure, deterministic, no IO — mirrorsparseFocusManifest's malformed-input-degrades-to-safe-defaults behavior insrc/signals/focus-manifest.tsexactly: a broken or missing.gittensory-miner.ymlmust never throw, it must degrade to an empty/neutral spec with a warning.Deliverables
packages/gittensory-engine/lib/miner-goal-spec.ts—export type MinerGoalSpec(fields per the schema-doc issue:preferredLanes,blockedPaths,maxFilesChanged,maxLoc,freshnessDays,avoidLabels,present: boolean,warnings: string[]) andexport function parseMinerGoalSpec(raw: unknown): MinerGoalSpec, following the exact malformed-input-degrades pattern ofparseFocusManifest(src/signals/focus-manifest.ts:995) — non-object input, array input, and unknown-field input all degrade to a safe empty spec with a warning pushed, never a thrown error.export function parseMinerGoalSpecContent(content: string | null | undefined): MinerGoalSpec— the YAML/JSON string-content wrapper, mirroringparseFocusManifestContent(src/signals/focus-manifest.ts:1043): empty/null content also degrades to the empty spec, not an exception.parseFocusManifest).MinerGoalSpecand both parse functions frompackages/gittensory-engine/lib/index.tssopackages/gittensory-minercan import them from@jsonbored/gittensory-engine.References
src/signals/focus-manifest.tslines 995-1043 (parseFocusManifest,parseFocusManifestContent) — the exact degrade-on-malformed-input pattern to mirror.gittensory-miner.yml.example(from the companion schema-doc issue) — the fixture shape to parsepackages/gittensory-engine/lib/index.ts(from the engine-scaffold issue) — where these exports land