Problem
The Task Pack refinement pipeline already tracks whether generation came from the refinement cache, but that status is not exposed consistently through the stored/public Task Pack contract.
Current repository state:
generateReliableTaskPack(...) returns cached: boolean;
- generation diagnostics also contain
cached;
- the renderer Task Pack type already includes optional
generationCached?: boolean;
- the storage Task Pack contract does not currently persist/expose
generationCached;
server/src/routes/taskPacks.ts stores generation metadata but does not pass generation.cached into the stored Task Pack record.
Goal
Expose whether the Task Pack refinement was served from cache as a public boolean field without duplicating cache-state logic.
Expected behavior
When a Task Pack is generated, the resulting stored/API Task Pack record should expose:
generationCached: boolean
The value must come from the existing generateReliableTaskPack(...).cached result.
Scope
Likely areas to inspect:
server/src/routes/taskPacks.ts
server/src/storage/types.ts
- SQLite/PostgreSQL Task Pack persistence and mapping
- relevant storage migrations if persistence requires a new column
- renderer/shared Task Pack contract
- focused generation/storage smoke coverage
Keep the change focused. Do not create a second cache-status source of truth.
Acceptance criteria
- Task Pack generation exposes
generationCached as a boolean.
- Cache hits produce
generationCached: true.
- Non-cached/template/fallback generation produces
generationCached: false.
- The value is sourced from existing generation cache diagnostics/result state.
- Persistence and API reads remain consistent across supported storage adapters.
- Existing Task Pack generation behavior remains unchanged apart from exposing the metadata.
- Relevant build and focused smoke checks pass.
Notes
This issue was originally created from a generated ContextForge Task Pack. The large generated prompt and diagnostic dump were removed to keep the public backlog focused and reviewable.
Problem
The Task Pack refinement pipeline already tracks whether generation came from the refinement cache, but that status is not exposed consistently through the stored/public Task Pack contract.
Current repository state:
generateReliableTaskPack(...)returnscached: boolean;cached;generationCached?: boolean;generationCached;server/src/routes/taskPacks.tsstores generation metadata but does not passgeneration.cachedinto the stored Task Pack record.Goal
Expose whether the Task Pack refinement was served from cache as a public boolean field without duplicating cache-state logic.
Expected behavior
When a Task Pack is generated, the resulting stored/API Task Pack record should expose:
generationCached: booleanThe value must come from the existing
generateReliableTaskPack(...).cachedresult.Scope
Likely areas to inspect:
server/src/routes/taskPacks.tsserver/src/storage/types.tsKeep the change focused. Do not create a second cache-status source of truth.
Acceptance criteria
generationCachedas a boolean.generationCached: true.generationCached: false.Notes
This issue was originally created from a generated ContextForge Task Pack. The large generated prompt and diagnostic dump were removed to keep the public backlog focused and reviewable.