Skip to content

Commit 2558b4f

Browse files
committed
Strengthen CA guardrails for Postman request and visualizer sync quality
- require 3-line visualizer script header including Visual Constraints line - ban vendor model firmware runtime fallback values in visualizer logic - add Postman request yaml guardrails for key order script language and sibling order uniqueness - add new endpoint workflow to create stub run sync update and keep visual as source of truth - add post-sync verification checklist for header palette language and order before commit - 2026-03-08 17:21:11
1 parent 7640410 commit 2558b4f

2 files changed

Lines changed: 321 additions & 321 deletions

File tree

CODING_AGENTS.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939
- Start new visual work from `visual/templates/Postman-Visualizer-SectionTemplate.md` and build the page section-by-section from that scaffold.
4040
- Do not manually edit generated visual docs (`docs/visual/`, `docs/visual-previews/`); regenerate from `visual/`.
4141
- No comments in visual code/templates unless explicitly requested.
42-
- Required exception: every visual script must begin with a two-line header comment in this format:
42+
- Required exception: every visual script must begin with a three-line header comment in this format:
4343
- `// Postman Visualizer: <<Description of Visual >>`
4444
- `// Last Update: <<Date and Time>>`
45+
- `// Visual Constraints: Follow canonical visual rules in CODING_AGENTS.md.`
4546
- No emoji in visual UI labels, titles, legends, table headers, axis labels, or status text unless explicitly requested.
4647
- At the top of each visual HTML file, maintain the visual rules/constraints and indicate that `CODING_AGENTS.md` defines the canonical rules so they are not forgotten.
4748
- Do not scatter magic numbers through visual HTML/script logic. Put tunable constants in a clearly named `TUNING` section near the top of the visual (for example chart heights, tick limits, sampling caps, render-bin caps, animation timings).
@@ -65,6 +66,8 @@
6566
- For `Moving Avg` overlays, use the same base color as `Actual` with a dashed line style.
6667
- Avoid redundant repetition of values already shown in `Device Info` (for example, do not repeat `MacAddress` in the channel header if it is already in the device table).
6768
- If `system_description` is missing/partial, render `N/A` for missing fields instead of vendor-specific fallback values.
69+
- Never hardcode vendor/model/firmware fallback values in visualizer runtime logic.
70+
- PyPNM generic placeholder values are for fixture JSON only and must not be used as runtime script fallbacks.
6871
- JSON responses may contain multiple upstream/downstream channels; each channel must render as its own graph for the selected graph type.
6972
- For multi-channel visuals with repeated per-channel panels/boxes, default to a 2-column layout (max 2 per row) with a 1-column fallback on narrower widths.
7073
- For channel-related multi-channel visuals, place the combined graph at the top and per-channel graphs below it.
@@ -91,3 +94,27 @@
9194
- Regression / trend / fitted reference lines must use a high-contrast color distinct from waveform traces (prefer dashed).
9295
- Default regression/reference line color: white.
9396
- If white reduces readability against the chart/waveform palette, use a dark red contrast line (for example `#c62828`) or another clearly contrasting color and document the choice in the visual remarks.
97+
98+
## Postman Request YAML Guardrails (Required)
99+
100+
- Use this top-level key order for every `*.request.yaml`:
101+
- `$kind`, `url`, `method`, `body`, `scripts`, `order`
102+
- Keep `language: text/javascript` present under every script entry.
103+
- Keep `order` unique among sibling requests in the same folder.
104+
- Request URL must use `{{variable}}` base prefix (no hardcoded host/base).
105+
- JSON bodies must use the repo escaped multi-line body style used by existing request files in that folder.
106+
107+
### New Endpoint Workflow (Do This Every Time)
108+
109+
- Create the new request YAML with the correct endpoint body and variable names.
110+
- Add a temporary visualizer stub header that matches the visual path.
111+
- Run `tools/postman/sync_visualizers.py --update` to copy script content from `visual/` 1:1.
112+
- Do not hand-edit long synced script blocks in YAML unless explicitly required; fix the source HTML in `visual/` and re-sync.
113+
114+
### Post-Sync Verification Checklist
115+
116+
- Confirm the script header has all 3 required lines.
117+
- Confirm canonical dark-blue palette is present (page `#141821`, panel `#1b2332`).
118+
- Confirm `language: text/javascript` is present.
119+
- Confirm sibling `order` remains unique.
120+
- If any check fails, fix source visual and rerun sync before commit.

0 commit comments

Comments
 (0)