100%

Section 10 - frontend detection + tailoring opt-in (INV-8a)

Goal

Detect a web frontend at install and emit a has_web_frontend signal that gates all INV-8 wiring; add the UI-scope path globs + a classify_ui_scope classifier. ori_lang (no frontend) trips no signal and stays inert. This is the foundation the design directive (s-11) and the design-system tier (s-12) gate on.

Implementation Sketch

Today detect_project_type (sync.py:443 in the sync skill; mirrored by harness_dist) returns LANGUAGE (ts/rust/python/ori), NOT surface. The detected type selects defaults/<type>.json, which drives tailoring — that is the wiring surface where a frontend project gets the design agent and a backend project does not.

  • Add a has_web_frontend signal (sibling of detect_project_type): positive on package.json deps containing react/vue/svelte/next/@angular, or apps/*/frontend, src/components/, an index.html + bundler config.
  • Add a frontend block to defaults/<type>.json + scripts/harness_dist/templates/sync-config.template.json written ON only for frontend-positive targets (enable-design-directive, ui-scope path globs, design-system-tier toggle).
  • Add classify_ui_scope(section_frontmatter, umbrella_frontmatter, touches)"ui" | "non-ui" (sibling of review_phase.v7_section_scope :1668 and schemas.classify_owns_crates_for_tp_dev :2388), keyed on a UI-path glob set (apps/frontend/, src/components/, *.tsx/*.vue/*.svelte) and/or an owns_surfaces: [ui] frontmatter declaration.
  • PLAN-AGNOSTIC / DOMAIN-AGNOSTIC per script-first.md §11: gated by the DECLARED install-time signal, NEVER a hard-coded project name. if project == "upstat" is a STRUCTURE:plan-specific-tooling-leak Critical.

Spec & Rule References

INV-8 (mission). script-first.md §11 (declare-nothing → runs nothing). Foundation for s-11, s-12.

Layer Coverage

Tooling-scope: L1-L11 N/A. L12 = detect/classify_ui_scope on frontend-positive vs backend-only fixtures asserting the signal + inert-on-ori_lang. pytest gate: sync-skill detection tests + harness_dist sync tests + classify_ui_scope unit tests.

Work Items

  • Add a has_web_frontend signal (sibling of detect_project_type) keyed on frontend deps/paths.
  • Add a frontend block to defaults/.json + sync-config.template.json written ON only for frontend-positive targets.
  • Add classify_ui_scope(…) -> ui|non-ui keyed on UI path globs / owns_surfaces; plan-agnostic, never a project-name branch.

Fresh intel (regenerated)

{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “installable-harness/s-dc03b1d1” }, “generated_at”: “2026-06-25T17:46:10.219684+00:00”, “graph_state”: { “head_sha”: “b74d6b9a”, “last_code_import_at”: “2026-06-25T17:46:02.647Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:installable-harness/s-dc03b1d1] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/installable-harness” } } }

(full dossier: frontend-detection—s-dc03b1d1.intel.json)