Skip to content

feat(autopilot:playbooks-guidance): phase 2 — field hints & inline field-path validation - #71

Merged
pacphi merged 1 commit into
developfrom
autopilot/playbooks-guidance/phase-2
Jul 1, 2026
Merged

feat(autopilot:playbooks-guidance): phase 2 — field hints & inline field-path validation#71
pacphi merged 1 commit into
developfrom
autopilot/playbooks-guidance/phase-2

Conversation

@pacphi

@pacphi pacphi commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Automated phase-2 run of the playbooks-guidance autopilot pipeline (ADR-006). Frontend only.

Deliverables

  • PlaybookFieldHints — a collapsible per-field schema guide next to the YAML editor documenting every playbook field, including the ADR-006 tool-ceiling narrow-only rule and the trusted-vars / untrusted-context split. Auto-expands and highlights the offending field on a validation error.
  • Inline field-path validationparsePlaybookError() turns the phase-0 field-path 422 (invalid playbook \`: ) into a structured error rendered against the offending field. Document-level ` errors are shown as a "playbook structure" problem, not a fake field.
  • i18n — new remediation:playbooks.* keys translated into all 26 locales via ampel-i18n-builder. Code-token lists (enum values, provider kinds, trusted vars) are injected via i18next interpolation values so they never reach the translator; {{vars}}/{{values}}/{{kinds}}/{{field}} verified intact across all 27 locales. types.ts regenerated.

DoD evidence

  • node scripts/i18n-coverage-report.js --check-missing → no missing keys
  • node scripts/i18n-coverage-report.js --check --min-coverage 95100%, all locales pass
  • make test-frontend917 passed / 6 skipped (incl. field-guide render + field-path + <root> structure-error specs)
  • make lint-frontend ✓ · pnpm type-check ✓ · make format-check
  • Interpolation-variable audit clean; brand/proper nouns never translated (injected as interpolation values); types.ts in sync.

Notes

Adversarial review caught that a <root> document-level error auto-expanded the guide while highlighting nothing — fixed to render a structure-level message and covered with a spec.

…eld-path validation

Frontend guidance (ADR-006):
- PlaybookFieldHints.tsx: collapsible per-field schema guide (role, tasks, loop,
  tools_policy, context_spec, output_contract, provider_overlays) documenting the
  tool-ceiling narrow-only rule and the trusted-vars/untrusted-context split;
  auto-expands and highlights the offending field.
- PlaybookEditor: parsePlaybookError() renders the phase-0 field-path 422 inline
  against the offending field; <root> shown as a document-level structure problem.
- Code-token lists injected via i18next interpolation values (kept out of
  translatable strings); new keys translated into all 26 locales,
  {{vars}}/{{values}}/{{kinds}}/{{field}} verified intact; types.ts regenerated.

Tests: 12 PlaybookEditor specs (3 new) + full suite (917 pass). i18n
--check-missing clean + coverage 100%. type-check/lint/format-check clean.
Adversarial review: 1 finding (<root> highlighted nothing) fixed + covered.
@pacphi

pacphi commented Jul 1, 2026

Copy link
Copy Markdown
Owner Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage Report

Component Coverage Status
Backend N/A%
Frontend N/A%
Overall N/A%

Coverage Thresholds

  • 🟢 Green: ≥ 80% (target)
  • 🟡 Yellow: 60-79% (acceptable)
  • 🔴 Red: < 60% (needs improvement)

Coverage reports generated by CI workflow

@pacphi
pacphi merged commit f55ab96 into develop Jul 1, 2026
21 checks passed
@pacphi
pacphi deleted the autopilot/playbooks-guidance/phase-2 branch July 1, 2026 17:42
pacphi added a commit that referenced this pull request Jul 1, 2026
* chore(autopilot:playbooks-guidance): promote plan to active pipeline + seed ledger

Retires the shipped remediation-model-catalog pipeline (survives in git history
and its ledger). Seeds record 0 of the playbooks-guidance session ledger. pr_ci
mode, base=develop, trunk=main, 4 phases.

* feat(autopilot:playbooks-guidance): phase 0 complete — gate PASSED (#69)

Embedded playbook endpoint + schema-aware field-path validation (ADR-006). All required CI checks green: CI Success, Backend Build/Lint/Unit(SQLite)/Integration(PostgreSQL)/Coverage/Security, frontend + i18n. Adversarial review: 2 findings fixed.

* feat(autopilot:playbooks-guidance): phase 1 complete — gate PASSED (#70)

Load built-in default + duplicate + preview pills; embedded endpoint wired; all i18n keys translated into 26 locales + types.ts regenerated. All required CI green (CI Success, Frontend Build/Lint, Validate React Translations, backend). Adversarial review: bogus locale dir fixed.

* feat(autopilot:playbooks-guidance): phase 2 complete — gate PASSED (#71)

Per-field schema hints + inline field-path validation errors; 27-locale i18n with interpolation-protected code tokens + types.ts regen. All required CI green (CI Success, Frontend Build/Lint, Validate React Translations, backend). Adversarial review: <root> error handling fixed.

* feat(autopilot:playbooks-guidance): phase 3 complete — gate PASSED (#72)

Docs (PLAYBOOKS.md) + preview no-model-call integration test. All required CI green after one rustfmt fix (CI Success, Backend Lint/Build/Integration(PostgreSQL), frontend, docs lint). Feature complete — all 4 phases shipped.

* chore(autopilot:playbooks-guidance): cross-phase optimization — gate PASSED (#73)

Shared invalid_playbook() 422 helper (create/update dedup). All required CI green.

* fix(remediation): refresh default model choices per config/models.yaml

The playbook embedded default overlays and the provider DEFAULT_MODEL fallbacks
held out-of-date model ids. Update both to current catalog choices:
- claude: claude-sonnet-4-6 -> claude-sonnet-5
- gemini: gemini-2.0-flash  -> gemini-2.5-flash (repriced 0.0003/0.0025 per 1k)
- ollama: qwen2.5-coder      -> qwen3-coder:30b-a3b-q4_K_M (runnable Ollama tag)

Updates crates/ampel-worker/playbooks/default.yaml (UI-visible overlays) and the
claude/gemini/ollama provider DEFAULT_MODEL constants (runtime fallback), plus
the gemini cost model + its two pricing tests to match 2.5-flash rates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant