Portrait Discipline
Applicable Scenarios
- Production and confirmation of character/product portraits (Gate G5 confirmation gate)
- Pre-requisite for rendering script portrait binding (binding-manifest)
Method
- Three-tier coverage: Lead 8 angles / Supporting 4 angles / Prop portraits; angle list first (
portrait.plan). - Three-mode parsing: studio (studio-generated) / uploaded (user-uploaded) / text (text description); verify each image with
refimage.verify. - Real reference image discipline: Product portraits must be based on real product images that passed archive scoring; fictional appearances are prohibited. When conflicting with the archive's
confirmedappearance field, record evidence and hand to human for confirmation—do not automatically reject and regenerate (T-2026-1001-0007). - PortraitGuard hard gate: Submitting rendering without bound portraits is forbidden.
- Background cleanliness hard gate (keying-friendly, 2026-09-24): The portrait background must be a completely uniform neutral light gray—no gradients, no vignettes, no light spots, no textures, no ground lines, no shadows; the subject's edges must contrast clearly with the background, enabling direct matting.
- Judgement caliper
clean-background/v1(packages/video-studio/src/portrait-agent.ts):- Outer band brightness span ≤ 30
- Outer band saturation ≤ 16
- Four-corner average brightness max difference ≤ 22
- Measured values written per angle into
portrait-sets/vN.json#backgroundChecks;
- Failure → re-run with reinforced wording; still fails → that angle is marked as failed (
failedAngles), not stored as success; - If probe is unavailable (missing ffmpeg), treat as failure—no silent pass;
- Portraits with unclean backgrounds must not be used by downstream compositing/keying: gray edges, vignettes, and shadows cannot be removed in post-production.
- Judgement caliper
Process Criteria (Condition → Parameter/Practice → Judgement)
| Condition | Parameter/Practice | Judgement | Source |
|---|---|---|---|
| Lead | 8-angle portrait set | All 4 mandatory angles present (Gate G5 hard gate) | KB:docs/pipeline-stages-and-gates-2026-09-24.md §2·G5 |
| Supporting | 4 angles | Angle list first; missing angles must be reported as-is, no fabricated angles | KB:This kit §Method 1 |
| Prop | Single prop portrait | Consistent with archive confirmed appearance field | KB:This kit §Method 3 |
| Background (keying-friendly) | Fully uniform neutral light gray: no gradients/vignettes/light spots/textures/ground lines/shadows | Outer band brightness span ≤30, outer band saturation ≤16, four-corner average brightness max difference ≤22 | KB:packages/video-studio/src/portrait-agent.ts#clean-background/v1 |
| Single asset validity | Dimensions and size meet threshold | Each image >50KB (one of Gate G5 criteria) | KB:pipeline-stages §2·G5 |
| Source mode | studio / uploaded / text three modes, verify each with refimage.verify | Each image annotated with mode + verification result | KB:This kit §Method 2 |
| Product portrait | Must be based on a real product image that passed archive scoring | When conflicting with confirmed appearance, record evidence, block ingestion/binding, hand to human for confirmation, then decide whether to regenerate | KB:data-mining-engine/SKILL.md §1·Iron Rules 2/5 |
| Probe availability | Missing ffmpeg → treat as failure | No silent pass | KB:This kit §Method 5 |
Parameter Boundaries
- No portrait binding → rendering submission is forbidden (PortraitGuard hard gate); no "render first, add portrait later" workflow.
- Background reinforcement re-run still fails → the angle is marked as failed and recorded in
failedAngles, not stored as success. - Portraits with unclean backgrounds must not be used for downstream compositing/keying (gray edges, vignettes, shadows cannot be removed in post-production).
- Real human portraits may only go through the platform authorization channel (Ark
asset://); direct upload of real human photos will be blocked by the privacy gate—do not attempt to bypass. - Angle file parsing must support fallback matching of "any-prefix-" (historically, inconsistent prefixes caused all 8 portraits to become "invisible").
Failure Modes (Symptom → Detector → Resolution)
| Symptom | Detector | Resolution |
|---|---|---|
| All 8 portraits fail to match ("invisible") | findAngleFile prefix fallback | Fix naming or use fallback matching; regression test locked |
| Missing angle causes null path crash | Safe byte count fetch + mandatory angle check | Report missing angle, do not throw ENOENT to break entire chain |
| Background has gray edges/vignettes/shadows | clean-background/v1 probe | Re-run with reinforced wording; still fails → mark failure |
| Probe unavailable yet marked as pass | Probe availability check | Mark as failure (no silent pass) |
| Fictional product appearance | Compare with archive confirmed field | Record evidence, block ingestion/binding, hand to human for confirmation before deciding regeneration (machine does not auto-regenerate) |
| Binding rendering before passing Gate G5 | binding-manifest / PortraitGuard | Block submission, return to Gate G5 confirmation |
Output Contract
- Output: Portrait set (angle list + per-image source mode + verification result + background probe measured values + ingestion version).
- Portrait set ingestion triggers Gate G5 human confirmation (
portrait-agent accept,via=owner-acceptance); machine-generated similarity/supervisory conclusions are only recorded as evidence—they do not gate release or trigger auto-regeneration; unconfirmed portraits must not be bound to rendering scripts. - Key numbers without tool receipt must be marked as "unverified" and not claimed as complete (L3.6/E3.7).
Boundaries
- Does not handle storyboarding or prompts (belongs to director/prompt engineer); this skill is solely responsible for portrait assets.
- Does not handle real human portrait authorization requests (go through platform authorization channel, done by humans).
- Does not accept "looks okay" as pass criterion: background pass/fail is determined solely by probe measured values.