> For the complete documentation index, see [llms.txt](https://faction-os.gitbook.io/faction-os-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/sessions/phase04-session04-visual-promotion-tooling-and-budgets/tasks.md).

# Task Checklist

**Session ID**: `phase04-session04-visual-promotion-tooling-and-budgets` **Total Tasks**: 22 **Estimated Duration**: 3-4 hours **Created**: 2026-05-29

***

## Legend

* `[x]` = Completed
* `[ ]` = Pending
* `[P]` = Parallelizable (can run with other \[P] tasks)
* `[SNNMM]` = Session reference (NN=phase number, MM=session number)
* `TNNN` = Task ID

***

## Progress Summary

| Category       | Total  | Done   | Remaining |
| -------------- | ------ | ------ | --------- |
| Setup          | 3      | 3      | 0         |
| Foundation     | 5      | 5      | 0         |
| Implementation | 10     | 10     | 0         |
| Testing        | 4      | 4      | 0         |
| **Total**      | **22** | **22** | **0**     |

***

## Setup (3 tasks)

Initial configuration and environment preparation.

### Repository tooling

* [x] T001 \[S0404] Record prerequisite outputs for `npm run media:check`, `npm run battlefield:check`, and `npm run media:drafts:check` (`.spec_system/specs/phase04-session04-visual-promotion-tooling-and-budgets/implementation-notes.md`)
* [x] T002 \[S0404] Map S0402 catalog records, S0403 draft manifest records, and S0404 matrix rows into the implementation plan (`.spec_system/specs/phase04-session04-visual-promotion-tooling-and-budgets/implementation-notes.md`)
* [x] T003 \[S0404] Add the root visual promotion command entry (`package.json`)

***

## Foundation (5 tasks)

Core structures and base implementations.

### Repository tooling

* [x] T004 \[S0404] \[P] Create visual promotion config for visual groups, dimensions, byte budgets, docs references, cache rules, and safe path prefixes with deterministic ordering (`scripts/media-visual-promotion-config.mjs`)
* [x] T005 \[S0404] \[P] Create report and validation helpers for stable issue codes, severity grouping, and explicit failure summaries with no raw local path or provider-secret exposure (`scripts/check-visual-media-promotion.mjs`)
* [x] T006 \[S0404] Implement repository-relative path validation for absolute, remote, parent-directory, unsupported-prefix, and `EXAMPLES/` paths with schema-validated input and explicit error mapping (`scripts/check-visual-media-promotion.mjs`)
* [x] T007 \[S0404] Implement image probe and metadata policy helpers for format, dimensions, byte size, optimized state, and metadata state with timeout, fallback, and failure-path handling (`scripts/check-visual-media-promotion.mjs`)
* [x] T008 \[S0404] Define visual promotion test fixtures for approved, conditional, planned, missing, stale-cache, and quarantined path scenarios (`tests/mediaVisualPromotion.test.ts`)

***

## Implementation (10 tasks)

Main feature implementation.

### Repository tooling

* [x] T009 \[S0404] Implement the `media:visual:check` CLI orchestration and exit-code behavior with deterministic ordering and explicit loading, empty, error, and unsupported-tool states (`scripts/check-visual-media-promotion.mjs`)
* [x] T010 \[S0404] Validate visual inventory file existence and output metadata for battlefield, portrait, brand, showcase, generated-reference, and draft visual records (`scripts/check-visual-media-promotion.mjs`)
* [x] T011 \[S0404] Enforce visual byte budgets and expected dimensions for approved and conditionally promoted image groups with clear budget-overrun remediation (`scripts/check-visual-media-promotion.mjs`)
* [x] T012 \[S0404] Enforce metadata policy for runtime-approved and conditional visual outputs while keeping pending metadata explicit for blocked records (`scripts/check-visual-media-promotion.mjs`)
* [x] T013 \[S0404] Validate app/public-demo mirror parity and public-demo service-worker cache coverage for shared visual media with deterministic hash and cache-list checks (`scripts/check-visual-media-promotion.mjs`)
* [x] T014 \[S0404] Validate stable docs and README path references for visual runtime, reference, brand, showcase, and generated-draft evidence (`scripts/check-visual-media-promotion.mjs`)
* [x] T015 \[S0404] Validate non-release blocker context for conditional, planned, deferred, prototype-only, rejected, unknown, and generated draft visual records (`scripts/check-visual-media-promotion.mjs`)
* [x] T016 \[S0404] Preserve battlefield parity behavior while aligning reusable budgets or check output with the visual promotion flow (`scripts/check-battlefield-assets.mjs`)

### Shared docs

* [x] T017 \[S0404] Document visual promotion prerequisites, command usage, failure remediation, and quarantine rules (`scripts/README_scripts.md`)
* [x] T018 \[S0404] Update media and assets docs with Session 04 promotion flow, current blockers, budget policy, metadata policy, and app/demo cache rules (`docs/media-assets.md`)

***

## Testing (4 tasks)

Verification and quality assurance.

### Repository tooling

* [x] T019 \[S0404] Add Vitest coverage for visual promotion config, path rejection, budget checks, report codes, cache drift, and blocked draft semantics (`tests/mediaVisualPromotion.test.ts`)
* [x] T020 \[S0404] Include top-level media promotion tests in the node Vitest project if needed (`vitest.config.ts`)
* [x] T021 \[S0404] Run focused validation for `npm run media:visual:check`, `npm run battlefield:check`, `npm run media:drafts:check`, and media promotion tests (`.spec_system/specs/phase04-session04-visual-promotion-tooling-and-budgets/implementation-notes.md`)
* [x] T022 \[S0404] Run final format, lint, ASCII/LF, and implementation-note validation before handoff (`.spec_system/specs/phase04-session04-visual-promotion-tooling-and-budgets/implementation-notes.md`)

***

## Completion Checklist

Before marking session complete:

* [x] All tasks marked `[x]`
* [x] All tests passing
* [x] All files ASCII-encoded
* [x] implementation-notes.md updated
* [x] Ready for the validate workflow step

***

## Next Steps

Run the implement workflow step to begin AI-led implementation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://faction-os.gitbook.io/faction-os-docs/.spec_system/archive/sessions/phase04-session04-visual-promotion-tooling-and-budgets/tasks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
