mo3ta-coverage 1.0.18 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT.md +144 -0
- package/README.md +54 -7
- package/RECOMMENDED_USAGE.md +20 -5
- package/VIDEO_PLAN.md +316 -0
- package/docs/poster.png +0 -0
- package/docs/poster.svg +131 -0
- package/index.js +32 -1
- package/package.json +1 -1
- package/src/cli.js +150 -89
- package/src/cli.test.js +127 -15
- package/src/fileUtils.js +241 -9
- package/src/fileUtils.test.js +98 -1
package/AGENT.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# AGENT.md
|
|
2
|
+
|
|
3
|
+
Guidance for coding agents working in this repository.
|
|
4
|
+
|
|
5
|
+
## What this project is
|
|
6
|
+
|
|
7
|
+
`mo3ta-coverage` is a Node.js CLI (published to npm) that:
|
|
8
|
+
|
|
9
|
+
1. Finds source files changed on the current branch vs a base branch.
|
|
10
|
+
2. Finds the test files related to those changed files.
|
|
11
|
+
3. Runs Jest only for those tests (or lets Jest expand them).
|
|
12
|
+
4. Parses `coverage/lcov.info` and checks coverage of the changed lines.
|
|
13
|
+
|
|
14
|
+
The primary use case is CI on pull requests: fail only when changed lines are not
|
|
15
|
+
covered enough, without running the entire test suite.
|
|
16
|
+
|
|
17
|
+
## Tech stack
|
|
18
|
+
|
|
19
|
+
- Node.js ESM (`"type": "module"`), no build step required for normal use.
|
|
20
|
+
- `commander` for the CLI.
|
|
21
|
+
- Jest 30 for this project's own tests.
|
|
22
|
+
- Babel (`@babel/preset-env`) only to transform JS for Jest.
|
|
23
|
+
- Runtime code lives in `index.js` and `src/`; `dist/` is not committed.
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install
|
|
29
|
+
npm test # jest --coverage
|
|
30
|
+
|
|
31
|
+
# Basic CLI run from another project
|
|
32
|
+
node /path/to/mo3ta-coverage/index.js --mode smart --base origin/main --limit 80
|
|
33
|
+
|
|
34
|
+
# This repository's CLI options
|
|
35
|
+
node index.js --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
There is no lint/typecheck/format script. `npm run build` currently outputs
|
|
39
|
+
`dist/index.js` from `index.js` only; it is not part of the normal workflow.
|
|
40
|
+
|
|
41
|
+
## Repository layout
|
|
42
|
+
|
|
43
|
+
| Path | Purpose |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| `index.js` | CLI entry point: option parsing, config file read/write, calls `main()`. |
|
|
46
|
+
| `src/cli.js` | Orchestration: changed files, test selection, Jest invocation, lcov reporting. |
|
|
47
|
+
| `src/fileUtils.js` | File classification and changed-file → test-file mapping. |
|
|
48
|
+
| `src/gitUtils.js` | Git repo/base-branch validation. |
|
|
49
|
+
| `src/cli.test.js` | Tests for lcov parsing, changed-line classification, summaries. |
|
|
50
|
+
| `src/fileUtils.test.js` | Tests for file filtering, naming conventions, import scanning. |
|
|
51
|
+
| `jest.config.json` | Jest config: `**/src/**/*.test.js`, node env, babel-jest transform. |
|
|
52
|
+
| `.mo3ta-coverage.json` | Optional per-project config (gitignored here). |
|
|
53
|
+
|
|
54
|
+
## Execution flow
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
index.js
|
|
58
|
+
└─ main(options) src/cli.js
|
|
59
|
+
├─ verifyGitRepoExists() src/gitUtils.js
|
|
60
|
+
├─ getExplicitFiles(options) --files / --filesFrom, or
|
|
61
|
+
├─ getChangedFiles(base) merge-base diff + working tree, all authors
|
|
62
|
+
├─ runRelatedTests(files, mode, depth)
|
|
63
|
+
│ └─ npx jest ... --coverage
|
|
64
|
+
└─ reportUncoveredChangedLines(...)
|
|
65
|
+
├─ parseLcov(path)
|
|
66
|
+
├─ getChangedLines(file, base) git diff -U0
|
|
67
|
+
├─ classifyChangedLineCoverage(...)
|
|
68
|
+
└─ exit 1 when overall coverage < limit
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Changed-file detection
|
|
72
|
+
|
|
73
|
+
`getChangedFiles()` unions:
|
|
74
|
+
|
|
75
|
+
- files changed between `merge-base HEAD <base>` and `HEAD` (all authors),
|
|
76
|
+
- unstaged changes,
|
|
77
|
+
- staged changes.
|
|
78
|
+
|
|
79
|
+
It keeps only `.js/.ts/.jsx/.tsx` and drops `node_modules`, `coverage`, `dist`,
|
|
80
|
+
`build`, and `.git` paths. Paths are relative to `process.cwd()`.
|
|
81
|
+
|
|
82
|
+
When `--files` or `--filesFrom` is provided, `getExplicitFiles()` normalizes the
|
|
83
|
+
list (comma/space separated, relative or absolute, de-duplicated) and auto
|
|
84
|
+
detection is skipped. Changed lines for those files are still computed against
|
|
85
|
+
`--base`, because `git diff -U0 <base> -- <file>` drives the coverage check.
|
|
86
|
+
|
|
87
|
+
### Modes
|
|
88
|
+
|
|
89
|
+
- `fast`: naming-convention matches only (plus changed test files), with the
|
|
90
|
+
existing direct import-scan fallback. No dependency traversal.
|
|
91
|
+
- `smart` (default): naming-convention matches **plus** a reverse-dependency
|
|
92
|
+
search over the import graph, limited by `--depth` (default `2`). This finds
|
|
93
|
+
spec files whose names do not match the source file and tests that reach the
|
|
94
|
+
changed file through one intermediate module (for example a barrel
|
|
95
|
+
`index.js`).
|
|
96
|
+
- `full`: passes the changed source and test files to
|
|
97
|
+
`jest --findRelatedTests`, letting Jest do unbounded traversal.
|
|
98
|
+
|
|
99
|
+
Depth semantics for `smart`: one edge = an import. `--depth 1` finds test files
|
|
100
|
+
that import the changed file directly. `--depth 2` also finds test files that
|
|
101
|
+
import a module which imports the changed file.
|
|
102
|
+
|
|
103
|
+
### Coverage reporting
|
|
104
|
+
|
|
105
|
+
- `parseLcov()` absolutizes `SF:` paths.
|
|
106
|
+
- Changed lines are the added line numbers from `git diff -U0 <base> -- <file>`.
|
|
107
|
+
- Only lines present in lcov (`DA:`) are counted; imports/comments are ignored.
|
|
108
|
+
- The overall ratio is computed across all changed, coverable lines.
|
|
109
|
+
- A missing lcov file exits with code 1; below-limit coverage exits with code 1.
|
|
110
|
+
- `main()` wraps everything and exits 1 on unexpected errors.
|
|
111
|
+
|
|
112
|
+
## Conventions
|
|
113
|
+
|
|
114
|
+
- Use ESM `import`/`export`; no CommonJS in `src/`.
|
|
115
|
+
- Keep functions small, pure where possible, and exported only when tested.
|
|
116
|
+
- File-path logic uses `fs`/`path` and must work with both relative git paths and
|
|
117
|
+
absolute lcov paths.
|
|
118
|
+
- Walkers skip `node_modules`, `.git`, `dist`, `build`, `coverage`, `.next`,
|
|
119
|
+
`.turbo`, and dot-directories (`SKIP_DIRS` plus the dot-prefix check).
|
|
120
|
+
- Import parsing is regex-based (`IMPORT_SPECIFIER_RE`), intentionally
|
|
121
|
+
dependency-free. It handles `import`, `export ... from`, `require`, dynamic
|
|
122
|
+
`import()`, and `jest.mock()`.
|
|
123
|
+
- Test files are recognized by `(\.test|\.spec)\.(js|ts|jsx|tsx)$`.
|
|
124
|
+
- New behavior in `src/fileUtils.js` or `src/cli.js` should come with tests in
|
|
125
|
+
the matching `*.test.js` file.
|
|
126
|
+
- Do not add runtime dependencies without a clear need; the package ships only
|
|
127
|
+
`commander`.
|
|
128
|
+
|
|
129
|
+
## Gotchas
|
|
130
|
+
|
|
131
|
+
- `findTestFilesForSource` and `findRelatedTestFilesBySource` return paths
|
|
132
|
+
relative to the scan root; `findTestFilesByImport` also accepts a `root` for
|
|
133
|
+
tests using temp fixtures.
|
|
134
|
+
- Import-graph and test-file scans are cached per root for the lifetime of the
|
|
135
|
+
process. Tests must use a fresh temp directory per fixture (they do).
|
|
136
|
+
- Alias resolution is heuristic: `@/` and `~/` are stripped, then the specifier
|
|
137
|
+
is matched against repo-relative paths by exact match or path suffix.
|
|
138
|
+
Over-matching is acceptable (it may run extra tests) but under-matching is not.
|
|
139
|
+
- `runRelatedTests` exits the process (`exit(0)`/`exit(1)`) rather than throwing.
|
|
140
|
+
- The config subcommand writes `.mo3ta-coverage.json` in `process.cwd()`.
|
|
141
|
+
- CLI options with commander defaults (`mode`, `depth`) override config unless
|
|
142
|
+
you check `program.getOptionValueSource(...) === 'cli'`.
|
|
143
|
+
- Shell commands are built as strings and run with `execSync`; quote/escape file
|
|
144
|
+
paths if this ever needs to support spaces.
|
package/README.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
# mo3ta-coverage 
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
mo3ta-coverage checks coverage for changed lines in a pull request. It finds changed source files, maps them to likely test files, runs Jest in a selected execution mode, and validates changed-line coverage against a threshold.
|
|
4
6
|
|
|
7
|
+
## Demo
|
|
8
|
+
|
|
9
|
+
https://github.com/user-attachments/assets/5241bfa7-ba66-4405-bf42-fd6522be56a6
|
|
10
|
+
|
|
11
|
+
A quick walkthrough of changed-file detection, related-test selection, and changed-line coverage.
|
|
12
|
+
|
|
5
13
|
## Features
|
|
6
14
|
|
|
7
|
-
- Detects changed JS/TS files from git history and working tree
|
|
8
|
-
-
|
|
15
|
+
- Detects changed JS/TS files from git history and working tree, for all authors
|
|
16
|
+
- Accepts an explicit file list (`--files` / `--filesFrom`) to control what gets scanned
|
|
17
|
+
- Maps changed source files to related test files, even when names differ
|
|
9
18
|
- Supports three execution modes: `fast`, `smart`, and `full`
|
|
19
|
+
- Walks reverse imports in `smart` mode to a configurable depth (default `2`)
|
|
10
20
|
- Parses `lcov.info` and reports uncovered changed lines
|
|
11
21
|
- Enforces a minimum coverage threshold for changed lines
|
|
12
22
|
|
|
@@ -31,12 +41,47 @@ mo3ta-coverage --mode smart --base origin/main --limit 80
|
|
|
31
41
|
| `--limit <percent>` | Minimum changed-line coverage percentage | `80` |
|
|
32
42
|
| `--showCovered <bool>` | Show covered changed lines in output | `false` |
|
|
33
43
|
| `--mode <mode>` | Execution mode: `fast`, `smart`, or `full` | `smart` |
|
|
44
|
+
| `--depth <number>` | Max reverse-import depth used by `smart` (`1` or `2` recommended) | `2` |
|
|
45
|
+
| `--files <files...>` | Scan only these files instead of auto-detecting changed files (space- or comma-separated) | – |
|
|
46
|
+
| `--filesFrom <path>` | Read the file list to scan from a newline-separated file | – |
|
|
47
|
+
|
|
48
|
+
## Scanning Selected Files
|
|
49
|
+
|
|
50
|
+
Changed files are detected from git for **all authors**, not just the current
|
|
51
|
+
git user. If you want to control exactly which files are scanned, pass them
|
|
52
|
+
directly. The library still maps them to tests and checks changed-line coverage.
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
# Explicit list (space-separated)
|
|
56
|
+
mo3ta-coverage --files src/a.js src/b.ts --base origin/main
|
|
57
|
+
|
|
58
|
+
# Explicit list (comma-separated)
|
|
59
|
+
mo3ta-coverage --files src/a.js,src/b.ts --base origin/main
|
|
60
|
+
|
|
61
|
+
# From a file containing one path per line
|
|
62
|
+
git diff --name-only origin/main > changed.txt
|
|
63
|
+
mo3ta-coverage --filesFrom changed.txt --base origin/main
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Explicitly provided files skip git changed-file detection. Their changed lines
|
|
67
|
+
are still computed against `--base`, so only lines that differ from the base
|
|
68
|
+
branch are counted toward coverage.
|
|
34
69
|
|
|
35
70
|
## Modes
|
|
36
71
|
|
|
37
|
-
- `fast`:
|
|
38
|
-
- `smart`:
|
|
39
|
-
- `full`:
|
|
72
|
+
- `fast`: Naming-convention matches only, plus a direct import-scan fallback. No dependency traversal.
|
|
73
|
+
- `smart`: Naming-convention matches plus a reverse-import walk from each changed file, limited by `--depth`. This finds spec files whose names differ and tests that reach the changed file through intermediate modules such as barrel `index.js` files. No Jest dependency traversal.
|
|
74
|
+
- `full`: Passes the changed source and test files to `jest --findRelatedTests`, letting Jest traverse without a depth limit.
|
|
75
|
+
|
|
76
|
+
### Depth in `smart` mode
|
|
77
|
+
|
|
78
|
+
One depth step is one import edge:
|
|
79
|
+
|
|
80
|
+
- `--depth 1`: test files that import the changed file directly.
|
|
81
|
+
- `--depth 2` (default): also test files that import a module which imports the changed file.
|
|
82
|
+
|
|
83
|
+
Depth `2` is usually the sweet spot: it catches barrel/re-export and thin wrapper
|
|
84
|
+
layers without pulling in the whole dependency graph.
|
|
40
85
|
|
|
41
86
|
## Recommended Mode
|
|
42
87
|
|
|
@@ -53,7 +98,7 @@ Use `full` only when you intentionally want Jest to expand to related tests.
|
|
|
53
98
|
You can persist defaults with the `config` subcommand:
|
|
54
99
|
|
|
55
100
|
```sh
|
|
56
|
-
mo3ta-coverage config --base origin/main --mode smart
|
|
101
|
+
mo3ta-coverage config --base origin/main --mode smart --depth 2
|
|
57
102
|
```
|
|
58
103
|
|
|
59
104
|
This writes `.mo3ta-coverage.json` in the project root.
|
|
@@ -62,7 +107,9 @@ This writes `.mo3ta-coverage.json` in the project root.
|
|
|
62
107
|
|
|
63
108
|
1. Reads CLI options and saved config from [index.js](index.js).
|
|
64
109
|
2. Finds changed source files from git in [src/cli.js](src/cli.js).
|
|
65
|
-
3. Maps source files to
|
|
110
|
+
3. Maps source files to related test files in [src/fileUtils.js](src/fileUtils.js).
|
|
111
|
+
`smart` mode combines naming conventions with a cached reverse-import index
|
|
112
|
+
and walks it up to `--depth` edges.
|
|
66
113
|
4. Runs Jest in the selected mode from [src/cli.js](src/cli.js).
|
|
67
114
|
5. Parses `lcov.info` and reports uncovered changed lines.
|
|
68
115
|
|
package/RECOMMENDED_USAGE.md
CHANGED
|
@@ -10,15 +10,29 @@ mo3ta-coverage --mode smart --base origin/main --limit 80
|
|
|
10
10
|
|
|
11
11
|
## Why `smart`
|
|
12
12
|
|
|
13
|
-
`smart` avoids Jest dependency traversal by running only test files that
|
|
13
|
+
`smart` avoids Jest dependency traversal by running only the related test files directly. It combines naming-convention matches with a depth-limited reverse-import walk: test files that directly import a changed file (`--depth 1`), or that import a module which imports it (`--depth 2`, the default). That catches differently named specs and barrel/re-export layers without pulling in the whole dependency graph, making it the most predictable mode for large projects.
|
|
14
14
|
|
|
15
15
|
## Mode Comparison
|
|
16
16
|
|
|
17
17
|
| Mode | What Jest Receives | Traversal | Typical Outcome |
|
|
18
18
|
|------|--------------------|-----------|-----------------|
|
|
19
|
-
| `fast` | mapped test files | none | fastest run |
|
|
20
|
-
| `smart` |
|
|
21
|
-
| `full` |
|
|
19
|
+
| `fast` | naming-mapped test files (+ direct import fallback) | none | fastest run |
|
|
20
|
+
| `smart` | related test files (naming + reverse imports, depth ≤ 2) | bounded | best balance |
|
|
21
|
+
| `full` | changed source/test files via `--findRelatedTests` | unbounded | can expand widely |
|
|
22
|
+
|
|
23
|
+
## Tuning `smart` Depth
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Direct importers only
|
|
27
|
+
mo3ta-coverage --mode smart --depth 1
|
|
28
|
+
|
|
29
|
+
# Direct importers plus one intermediate module (default)
|
|
30
|
+
mo3ta-coverage --mode smart --depth 2
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use `--depth 1` when modules are tested directly. Keep `--depth 2` when the
|
|
34
|
+
codebase uses barrel `index.js` files or thin wrapper modules between a helper
|
|
35
|
+
and its spec.
|
|
22
36
|
|
|
23
37
|
## Project Setup
|
|
24
38
|
|
|
@@ -33,7 +47,8 @@ mo3ta-coverage --mode smart --base origin/main --limit 80
|
|
|
33
47
|
```json
|
|
34
48
|
{
|
|
35
49
|
"base": "origin/main",
|
|
36
|
-
"mode": "smart"
|
|
50
|
+
"mode": "smart",
|
|
51
|
+
"depth": 2
|
|
37
52
|
}
|
|
38
53
|
```
|
|
39
54
|
|
package/VIDEO_PLAN.md
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
# mo3ta-coverage — Video Production Plan
|
|
2
|
+
|
|
3
|
+
Status: **in progress** · Owner: next agent · Last updated: 2026-11-19
|
|
4
|
+
|
|
5
|
+
Goal: produce two local MP4 promo videos for `mo3ta-coverage` using the
|
|
6
|
+
OpenMontage / HyperFrames skill:
|
|
7
|
+
|
|
8
|
+
1. **5s teaser** — first deliverable.
|
|
9
|
+
2. **15s explainer** — full story, built only after the 5s cut is approved.
|
|
10
|
+
|
|
11
|
+
No API keys, TTS, stock footage, or music are required. Everything is authored
|
|
12
|
+
as HTML/CSS/GSAP and rendered locally with HyperFrames + FFmpeg.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Inputs and environment
|
|
17
|
+
|
|
18
|
+
| Item | Value |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Video skill / vendor | `/Users/appleworld/Documents/Diff/vendor/OpenMontage` |
|
|
21
|
+
| HyperFrames guide | `OpenMontage/skills/core/hyperframes.md` |
|
|
22
|
+
| Authoring contract | `OpenMontage/.agents/skills/hyperframes-core/SKILL.md` |
|
|
23
|
+
| Reference composition | `OpenMontage/projects/json-change-explainer/hyperframes/index.html` |
|
|
24
|
+
| Cached HyperFrames CLI | `/Users/appleworld/.npm/_npx/702923228c2ce1e6/node_modules/.bin/hyperframes` (v0.9.23) |
|
|
25
|
+
| Fallback CLI | `npx --yes hyperframes@0.9.23` |
|
|
26
|
+
| Node | v24.14.1 |
|
|
27
|
+
| FFmpeg / FFprobe | 8.1.1 (`/opt/homebrew/bin`) |
|
|
28
|
+
| Chrome headless | cached at `~/.cache/hyperframes/chrome` |
|
|
29
|
+
|
|
30
|
+
Do **not** use `npx @hyperframes/cli` (404). The public package is `hyperframes`.
|
|
31
|
+
|
|
32
|
+
Convenience for every command below:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
export HF=/Users/appleworld/.npm/_npx/702923228c2ce1e6/node_modules/.bin/hyperframes
|
|
36
|
+
export REPO=/Users/appleworld/Documents/mo3ta-coverage
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 2. Deliverables
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
/Users/appleworld/Documents/mo3ta-coverage/
|
|
45
|
+
├── VIDEO_PLAN.md <- this file
|
|
46
|
+
└── video/
|
|
47
|
+
├── .gitignore <- ignores .hyperframes/ and renders/
|
|
48
|
+
├── mo3ta-coverage-5s/
|
|
49
|
+
│ ├── index.html <- HyperFrames composition
|
|
50
|
+
│ ├── gsap.min.js <- local GSAP (offline render)
|
|
51
|
+
│ └── hyperframes.json
|
|
52
|
+
├── mo3ta-coverage-15s/
|
|
53
|
+
│ ├── index.html
|
|
54
|
+
│ ├── gsap.min.js
|
|
55
|
+
│ └── hyperframes.json
|
|
56
|
+
└── renders/
|
|
57
|
+
├── mo3ta-coverage-5s.mp4
|
|
58
|
+
└── mo3ta-coverage-15s.mp4
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Output spec: **1920×1080, 30 fps, H.264 MP4, no audio track**.
|
|
62
|
+
|
|
63
|
+
If `video/` is committed later, add `/video/renders/` (or all of `/video/`) to
|
|
64
|
+
`.npmignore` so MP4s are not published to npm.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 3. Product story
|
|
69
|
+
|
|
70
|
+
`mo3ta-coverage` runs only the tests related to the lines changed in a PR, then
|
|
71
|
+
checks coverage for those changed lines.
|
|
72
|
+
|
|
73
|
+
Key message:
|
|
74
|
+
|
|
75
|
+
> **Changed code. Related specs. Real coverage.**
|
|
76
|
+
|
|
77
|
+
Supporting points:
|
|
78
|
+
|
|
79
|
+
- Finds changed JS/TS files against a base branch.
|
|
80
|
+
- `smart` mode finds related spec files even when names differ.
|
|
81
|
+
- Uses a depth-limited reverse-import graph (`--depth 1` or `2`) to catch
|
|
82
|
+
barrel/re-export layers without running the whole suite.
|
|
83
|
+
- Reports uncovered changed lines and fails below a coverage limit.
|
|
84
|
+
- Works locally and in CI.
|
|
85
|
+
|
|
86
|
+
Example command to show on screen:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npx mo3ta-coverage --mode smart --base origin/main --limit 80
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 4. Creative direction
|
|
95
|
+
|
|
96
|
+
**Look:** dark developer tool, editorial motion graphics, no people, no stock
|
|
97
|
+
footage. Crisp mono labels, syntax-colored diff lines, subtle grid and glow.
|
|
98
|
+
|
|
99
|
+
| Token | Value | Use |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `--bg` | `#0F1115` | canvas |
|
|
102
|
+
| `--card` | `#1A1C22` | terminal / report panels |
|
|
103
|
+
| `--border` | `#2A2D35` | panel borders |
|
|
104
|
+
| `--text` | `#E6E6E6` | body |
|
|
105
|
+
| `--bright` | `#F4F7FB` | headlines |
|
|
106
|
+
| `--muted` | `#9AA0A6` | secondary copy |
|
|
107
|
+
| `--accent` | `#60A5FA` | brand / CTA |
|
|
108
|
+
| `--pass` | `#22C55E` | covered lines, pass |
|
|
109
|
+
| `--fail` | `#F87171` | uncovered lines |
|
|
110
|
+
| `--warn` | `#FB923C` | attention |
|
|
111
|
+
|
|
112
|
+
Fonts: **Inter** for UI/headlines, **JetBrains Mono** for code. Both are
|
|
113
|
+
supported by the HyperFrames deterministic font compiler.
|
|
114
|
+
|
|
115
|
+
Motion: 0.4–0.8s power2/power3 eases, 18–42px rise, small staggers. No infinite
|
|
116
|
+
loops, no unseeded randomness, no clocks.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 5. Storyboard — 5s teaser
|
|
121
|
+
|
|
122
|
+
Duration: **5.0s**. One continuous dark stage.
|
|
123
|
+
|
|
124
|
+
| Time | Scene | Content | Motion |
|
|
125
|
+
| --- | --- | --- | --- |
|
|
126
|
+
| 0.0–1.2 | Hook | Pill `PR COVERAGE · SMART MODE` + wordmark `mo3ta-coverage` + line `Changed code. Related specs.` | fade-up cascade |
|
|
127
|
+
| 1.2–2.6 | Command | Terminal card, types `npx mo3ta-coverage --mode smart` then `--base origin/main` | caret blink via finite steps, prompt glow |
|
|
128
|
+
| 2.6–3.9 | Smart graph | Left: `src/utils/helper.js` changed. Right: `specs/custom-name.spec.js`. Arrow/label `related spec · depth 1` | nodes pop, link draws, label fades |
|
|
129
|
+
| 3.9–5.0 | Result | Report card: `100% changed-line coverage`, green check, `limit 80%` | count-up, check draws, hold |
|
|
130
|
+
|
|
131
|
+
Copy:
|
|
132
|
+
|
|
133
|
+
- `Changed code. Related specs.`
|
|
134
|
+
- `Even when the test name doesn't match.`
|
|
135
|
+
- `100% changed-line coverage`
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 6. Storyboard — 15s explainer
|
|
140
|
+
|
|
141
|
+
Duration: **15.0s**.
|
|
142
|
+
|
|
143
|
+
| Time | Scene | Content | Motion |
|
|
144
|
+
| --- | --- | --- | --- |
|
|
145
|
+
| 0.0–2.0 | Hook | Pill, wordmark, `Changed code. Related specs. Real coverage.` | title cascade |
|
|
146
|
+
| 2.0–4.8 | Problem | Mini PR diff: 3 changed lines. Text `Running the whole suite is slow.` | diff rows slide in, muted clock motif |
|
|
147
|
+
| 4.8–8.0 | Smart mode | Command types; graph builds: changed file → barrel → differently named spec, labels `depth 1` / `depth 2` | graph nodes + link draw, depth badges pulse once |
|
|
148
|
+
| 8.0–11.0 | Coverage | Jest result panel: `PASS specs/custom-name.spec.js`, coverage table, changed lines turn green/red | rows cascade, line markers pop |
|
|
149
|
+
| 11.0–13.0 | Verdict | `Overall changed-line coverage 100%` vs `limit 80%`, `Not covered: 0 of 3` | counter + progress bar fill |
|
|
150
|
+
| 13.0–15.0 | CTA | End card: wordmark, `Changed code. Related specs. Real coverage.`, command pill | fade-up, hold |
|
|
151
|
+
|
|
152
|
+
Narrative copy:
|
|
153
|
+
|
|
154
|
+
1. `Every PR changes a few lines.`
|
|
155
|
+
2. `But CI runs the whole suite.`
|
|
156
|
+
3. `mo3ta-coverage starts from changed files.`
|
|
157
|
+
4. `Smart mode walks imports to depth 1 or 2.`
|
|
158
|
+
5. `It finds the right spec — even with a different name.`
|
|
159
|
+
6. `Then checks coverage for changed lines only.`
|
|
160
|
+
7. `Fail the build only when the diff is under-covered.`
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 7. HyperFrames authoring rules
|
|
165
|
+
|
|
166
|
+
- Root is a standalone `<div data-composition-id="..." data-width="1920"
|
|
167
|
+
data-height="1080" data-start="0" data-duration="5">` (or `15`).
|
|
168
|
+
- Add `data-fps="30"` on the root if supported; otherwise pass `-f 30` at render.
|
|
169
|
+
- Scene wrappers use `class="clip"` with `data-start`, `data-duration`,
|
|
170
|
+
`data-track-index`.
|
|
171
|
+
- Register exactly one timeline synchronously:
|
|
172
|
+
`window.__timelines["<composition-id>"] = gsap.timeline({ paused: true })`.
|
|
173
|
+
- Animate only transform/opacity/color/filter/clip-path properties.
|
|
174
|
+
- No `repeat: -1`; use finite repeats for caret blink.
|
|
175
|
+
- Put the full-bleed background on a child `position:absolute; inset:0`, not on
|
|
176
|
+
the root element.
|
|
177
|
+
- Keep all IDs unique.
|
|
178
|
+
- No `<br>` inside paragraph copy.
|
|
179
|
+
|
|
180
|
+
Minimal root shape:
|
|
181
|
+
|
|
182
|
+
```html
|
|
183
|
+
<div id="root" data-composition-id="mo3ta-5s"
|
|
184
|
+
data-width="1920" data-height="1080"
|
|
185
|
+
data-start="0" data-duration="5" data-fps="30">
|
|
186
|
+
<div class="stage clip" data-start="0" data-duration="5" data-track-index="0">
|
|
187
|
+
<!-- scenes -->
|
|
188
|
+
</div>
|
|
189
|
+
</div>
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 8. Build and verification commands
|
|
195
|
+
|
|
196
|
+
Run from the workspace directory:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
cd "$REPO/video/mo3ta-coverage-5s"
|
|
200
|
+
$HF lint .
|
|
201
|
+
$HF check . --at 0.5,1.5,3.0,4.5 --no-contrast
|
|
202
|
+
$HF snapshot . --at 0.5,1.5,3.0,4.5
|
|
203
|
+
$HF render . -o "$REPO/video/renders/mo3ta-coverage-5s.mp4" -q standard -f 30
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Repeat for `mo3ta-coverage-15s` with sample times `1,3,6,9,12,14.5`.
|
|
207
|
+
|
|
208
|
+
Verify every render:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
ffprobe -v error \
|
|
212
|
+
-show_entries format=duration,size:stream=codec_name,width,height,r_frame_rate \
|
|
213
|
+
-of default=noprint_wrappers=1 \
|
|
214
|
+
"$REPO/video/renders/mo3ta-coverage-5s.mp4"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Acceptance:
|
|
218
|
+
|
|
219
|
+
- 5s file duration `5.0 ± 0.05s`.
|
|
220
|
+
- 15s file duration `15.0 ± 0.05s`.
|
|
221
|
+
- 1920×1080, ~30 fps, `h264`, sensible file size.
|
|
222
|
+
- `lint` has 0 errors. `check` has no errors (contrast may be deferred during
|
|
223
|
+
iteration, but should be re-run before calling the cut final).
|
|
224
|
+
- Keyframe snapshots readable at 100% zoom: no clipped text, no overlapping
|
|
225
|
+
cards, no black frames.
|
|
226
|
+
- CTA command is legible and correctly spelled.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 9. Checklist
|
|
231
|
+
|
|
232
|
+
### Discovery
|
|
233
|
+
- [x] Locate the OpenMontage vendor/skill.
|
|
234
|
+
- [x] Read HyperFrames core contract and OpenMontage HyperFrames guide.
|
|
235
|
+
- [x] Verify Node 24, FFmpeg 8.1.1, cached Chrome, cached HyperFrames CLI.
|
|
236
|
+
- [x] Pick 16:9 / 1080p / 30 fps / no-audio delivery.
|
|
237
|
+
- [x] Lock the storyboard, copy, and visual tokens above.
|
|
238
|
+
|
|
239
|
+
### 5s teaser
|
|
240
|
+
- [x] Create `video/mo3ta-coverage-5s/` + `hyperframes.json`.
|
|
241
|
+
- [x] Author `index.html` (hook → command → smart graph → result).
|
|
242
|
+
- [x] `lint` passes with 0 errors.
|
|
243
|
+
- [x] `check` / snapshots reviewed at 0.5s, 1.5s, 3.0s, 4.5s.
|
|
244
|
+
- [x] Render `video/renders/mo3ta-coverage-5s.mp4`.
|
|
245
|
+
- [x] Verify duration / resolution / fps with `ffprobe`.
|
|
246
|
+
- [x] Share the 5s cut for approval before starting the 15s.
|
|
247
|
+
|
|
248
|
+
### 15s explainer
|
|
249
|
+
- [x] Create `video/mo3ta-coverage-15s/` + `hyperframes.json`.
|
|
250
|
+
- [x] Author `index.html` (hook → problem → smart graph → coverage → verdict → CTA).
|
|
251
|
+
- [x] `lint` passes with 0 errors.
|
|
252
|
+
- [x] `check` / snapshots reviewed across all six beats.
|
|
253
|
+
- [x] Render `video/renders/mo3ta-coverage-15s.mp4`.
|
|
254
|
+
- [x] Verify duration / resolution / fps with `ffprobe`.
|
|
255
|
+
|
|
256
|
+
### Wrap-up
|
|
257
|
+
- [x] Add `/video/renders/` to `.gitignore`; add `/video` to `.npmignore`.
|
|
258
|
+
- [ ] Link both MP4s from `README.md` (optional).
|
|
259
|
+
- [ ] Commit the plan and workspaces (renders stay local).
|
|
260
|
+
- [x] Share final paths with the user.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 10. Handoff notes
|
|
265
|
+
|
|
266
|
+
### Status (2026-11-19)
|
|
267
|
+
|
|
268
|
+
Both cuts are **rendered and verified**:
|
|
269
|
+
|
|
270
|
+
| Output | Duration | Resolution | FPS | Codec | Size |
|
|
271
|
+
| --- | --- | --- | --- | --- | --- |
|
|
272
|
+
| `video/renders/mo3ta-coverage-5s.mp4` | 5.000s | 1920×1080 | 30 | h264 | 578 KB |
|
|
273
|
+
| `video/renders/mo3ta-coverage-15s.mp4` | 15.000s | 1920×1080 | 30 | h264 | 1.1 MB |
|
|
274
|
+
|
|
275
|
+
`lint` → 0 errors on both. `check` → 0 errors on both; remaining items are
|
|
276
|
+
advisory warnings only (`nested_structure_needs_subcomposition` for the single
|
|
277
|
+
`#stage` clip, small-UI-type floor, and `line_unread` on transitional captions).
|
|
278
|
+
No blocking errors.
|
|
279
|
+
|
|
280
|
+
Implementation details worth knowing:
|
|
281
|
+
|
|
282
|
+
- Both workspaces load a local `gsap.min.js` (copied beside `index.html`), so
|
|
283
|
+
rendering works offline. Fonts still come from the Google Fonts `@import`
|
|
284
|
+
and are cached in `~/.cache/hyperframes/fonts`.
|
|
285
|
+
- `hyperframes check` flagged an over-short final hold on the 15s end card, so
|
|
286
|
+
the end card was pulled forward and the CTA command shortened to
|
|
287
|
+
`npx mo3ta-coverage --mode smart`. The full command with `--base origin/main`
|
|
288
|
+
still appears in the 5s teaser's typing beat.
|
|
289
|
+
- Frame 0 was intentionally made non-empty in both cuts by keeping the hook
|
|
290
|
+
visible and animating only transforms (no initial opacity 0 on `#hook`).
|
|
291
|
+
- Snapshot contact sheets live under each workspace's
|
|
292
|
+
`.hyperframes/artifacts/snapshots/` (git-ignored along with the rest of
|
|
293
|
+
`.hyperframes/`).
|
|
294
|
+
- `video/renders/` is git-ignored; `/video` is npm-ignored so MP4s and
|
|
295
|
+
workspaces never ship in the published package.
|
|
296
|
+
|
|
297
|
+
### Optional next steps
|
|
298
|
+
|
|
299
|
+
- Add a short README section linking the MP4s.
|
|
300
|
+
- Commit `VIDEO_PLAN.md` and both `video/mo3ta-coverage-*/` workspaces
|
|
301
|
+
(leave `video/renders/` local).
|
|
302
|
+
- If a voiceover or music bed is wanted later, add it in HyperFrames/FFmpeg;
|
|
303
|
+
current cuts are intentionally silent and caption-free so they loop cleanly
|
|
304
|
+
in a README or social post.
|
|
305
|
+
|
|
306
|
+
### Product references
|
|
307
|
+
|
|
308
|
+
- Source of truth for the product behavior is `src/fileUtils.js` and
|
|
309
|
+
`src/cli.js`; smart mode = naming matches + reverse-import walk to
|
|
310
|
+
`--depth` (default 2).
|
|
311
|
+
- The 5s piece stands alone without narration.
|
|
312
|
+
- If the cached CLI is missing on another machine, use
|
|
313
|
+
`npx --yes hyperframes@0.9.23`; `doctor` must pass Node/FFmpeg/Chrome before
|
|
314
|
+
rendering.
|
|
315
|
+
- Do not switch to Remotion or FFmpeg silently. If HyperFrames fails, report the
|
|
316
|
+
blocker and get approval before downgrading runtime.
|
package/docs/poster.png
ADDED
|
Binary file
|