Skip to content

Commit d2ec894

Browse files
akshay-vizCopilot
andcommitted
docs(model-apps): consolidate the feature-flag gates and unfile the TSX lexer notes
Answering "consolidate or move?" for the 104-line Feature Flags section: CONSOLIDATE, and keep it in AGENTS.md. Why not move it to docs/: AGENTS.md is auto-loaded into agent context; docs/*.md are not - an agent has to choose to open them. These are fail-closed safety gates whose failure mode is shipping unreleased functionality, so they belong in the always-loaded file. Moving them would make the rule less likely to be followed, which is the opposite of the point. Two changes, both found by reading the section rather than its title: 1. The two gate checklists were STRUCTURALLY IDENTICAL - five numbered points with the same five categories (discovery, scripts, deploy, ALM, codegen), written out twice. The shared rule is now stated once and the per-feature specifics live in a table, with the one genuine asymmetry called out separately (the connectors dispatch value overriding the plan section). Every fact survives - verified by grepping for the 12 load-bearing specifics (helper names, phase numbers, ECS setting, ALM branch, emitted APIs) after the edit. 2. `scripts/lib/source-literals.js - known limits` was sitting INSIDE the Feature Flags section. The TSX lexer has nothing to do with feature flags; it is a component spec that landed in the wrong place, and it accounted for a quarter of the section's length. Promoted to its own `## TSX source lexer - known limits` section. The file-tree entry that says 'see "Known limits" below' now points at a real section. Net -6 lines, which undersells it: ~35 lines of duplicated prose became a table, and ~28 lines moved to where they belong. Also fixes line-ending drift I introduced: the restructure script joined with \r\n on a file that is LF on main, rewriting all 850 lines. Restored to LF, so the diff is the real 39/45. Checked the whole branch for the same mistake - no other file changed style vs origin/main. Docs only. Plugin suite 1474 pass, 6/6 validators. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 42626da2-b66f-4162-acaa-b1127ef23d89
1 parent db91a90 commit d2ec894

1 file changed

Lines changed: 39 additions & 45 deletions

File tree

plugins/model-apps/AGENTS.md

Lines changed: 39 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,45 @@ values in `feature-flags.json` at the plugin root.
545545
values in the committed file (so a typo can't silently do nothing, or — after a flip
546546
to `true` — accidentally enable the wrong thing).
547547

548+
**Each gated feature has a SINGLE OWNER agent, and every entry point must go through it or the
549+
shared helper.** Both currently-gated features gate at the same five places, so the rule is stated
550+
once here and only the per-feature specifics are tabled below:
551+
552+
1. **Discovery** — the owner agent runs the probe first; planners/edit-planners delegate to it and
553+
never gate inline.
554+
2. **Scripts** — each entry-point script calls the shared `exitIf<Feature>Disabled()` helper (DRY —
555+
never an inlined gate) and fails closed with exit 3 when OFF.
556+
3. **Deploy** — the SKILL phase **re-probes** the flag and treats an absent/malformed bindings
557+
section as *no bindings*, so a plan authored while the flag was ON cannot deploy after it goes OFF.
558+
4. **ALM** — solution packaging honours the flag (or documents why it needs no gate).
559+
5. **Codegen**`genpage-page-builder` emits feature code **only** when the plan carries an actual
560+
binding table, never on an absent/sentinel section.
561+
562+
| | `connectors` | `custom-api` |
563+
|---|---|---|
564+
| **Owner agent** | `genpage-connector-builder` | `genpage-customapi-builder` |
565+
| **Plan section** | `## Connector Bindings` | `## Custom API Bindings` |
566+
| **Gated scripts** | `list-connections.js`, `create-connection-reference.js` | `list-custom-apis.js` |
567+
| **Deploy phase** | SKILL Phase 4.5 | SKILL Phase 4.6 |
568+
| **ALM** | the `--connection-refs` branch of `add-page-to-solution.js` | none needed — `config.json`'s `actionBindings` travels inside the page's `uxagentprojectfile` rows automatically (the Custom APIs themselves are a separate deployment prerequisite, bound by name) |
569+
| **Emits** | connector code | `executeAction` / `executeFunction` / `listBoundActions` |
570+
571+
One connectors-only nuance: at Phase 4.5 the `/genpage` orchestrator re-probes and passes the
572+
verbatim result as `Connectors: enabled|disabled` in every page-builder dispatch — **that dispatch
573+
value wins over the plan's `## Connector Bindings` section.**
574+
575+
Both flags currently ship **OFF**, each waiting on cross-repo dependencies:
576+
577+
- **`connectors`** — the pac CLI connector verbs (PowerPlatform-Scale-AdminTools), the GenUX
578+
authoring control (power-platform-ux), and the maker/admin ECS setting must all release first.
579+
- **`custom-api`** — the AIBuilder CoderAgent action prompt, the shared `pai-gen-ux-action-runtime`
580+
plus the UCI and Controls host runtimes, a pac CLI `model genpage upload --actions` verb to
581+
persist `actionBindings` into `config.json`, and the `GenUxPluginActionAllowList` ECS setting.
582+
Note the maker-facing name is "Custom API" while the shipped wire contract stays
583+
`actionBindings` / `executeAction` (see `references/custom-api.md`).
584+
585+
## TSX source lexer — known limits
586+
548587
**`scripts/lib/source-literals.js` — known limits.** It is a hand-rolled TSX lexer, not a
549588
parser: the plugin ships dependency-free, so there is no TypeScript to call. It tracks
550589
code / line comment / block comment / string / template / regex / JSX tag / JSX text, and
@@ -573,51 +612,6 @@ Residual limits, accepted deliberately:
573612
Neither shape occurs in the corpus, and both fail *loudly* (exit 3, retryable) rather than
574613
silently. If you hit one, widen the tests first.
575614

576-
**Connectors gate — the single owner is `genpage-connector-builder`.** Every connector
577-
entry point must go through it or the helper; the checklist of places that gate:
578-
579-
1. Discovery + codegen — the top-level `/genpage` orchestrator dispatches
580-
`genpage-connector-builder`, which runs the initial probe. At Phase 4.5 the
581-
orchestrator re-probes with
582-
`node "${PLUGIN_ROOT}/scripts/lib/feature-flags.js" connectors` and passes the
583-
verbatim result as `Connectors: enabled|disabled` in every page-builder dispatch;
584-
this dispatch value wins over the plan's `## Connector Bindings` section.
585-
2. Scripts — `list-connections.js` / `create-connection-reference.js` (`exitIfConnectorsDisabled`).
586-
3. Deploy — SKILL Phase 4.5 **re-probes** the flag and treats absent/malformed
587-
`## Connector Bindings` as no bindings (a plan authored while ON must not deploy
588-
connectors after OFF).
589-
4. ALM — the `--connection-refs` branch of `add-page-to-solution.js`.
590-
5. Codegen — `genpage-page-builder` emits connector code only when the plan has an
591-
actual binding table (never on an absent/sentinel section).
592-
593-
The **`connectors`** flag currently ships OFF: GenPage connector support needs the
594-
pac CLI connector verbs (PowerPlatform-Scale-AdminTools), the GenUX authoring control
595-
(power-platform-ux), and the maker/admin ECS setting to all be released first.
596-
597-
**Custom API gate — the single owner is `genpage-customapi-builder`.** Every Custom API
598-
entry point must go through it or the helper; the checklist of places that gate:
599-
600-
1. Discovery — `genpage-customapi-builder` runs the probe first (planner + edit-planner
601-
delegate to it; they do not gate inline).
602-
2. Scripts — `list-custom-apis.js` (`exitIfCustomApiDisabled`).
603-
3. Deploy — SKILL Phase 4.6 **re-probes** the flag and treats absent/malformed
604-
`## Custom API Bindings` as no bindings (a plan authored while ON must not deploy
605-
Custom API bindings after OFF).
606-
4. ALM — none needed: `config.json`'s `actionBindings` travels inside the page's
607-
`uxagentprojectfile` rows automatically (the Custom APIs themselves are a separate
608-
deployment prerequisite, bound by name).
609-
5. Codegen — `genpage-page-builder` emits `executeAction` / `executeFunction` /
610-
`listBoundActions` code only when the plan has an actual binding table (never on an
611-
absent/sentinel section).
612-
613-
The **`custom-api`** flag currently ships OFF: GenPage Custom API invocation needs the
614-
AIBuilder CoderAgent action prompt, the shared `pai-gen-ux-action-runtime` plus the UCI and
615-
Controls host runtimes, a pac CLI `model genpage upload --actions` verb
616-
(PowerPlatform-Scale-AdminTools) to persist `actionBindings` into `config.json`, and the
617-
`GenUxPluginActionAllowList` ECS setting to all be released first. Note the maker-facing name
618-
is "Custom API" while the shipped wire contract stays `actionBindings` / `executeAction`
619-
(see `references/custom-api.md`).
620-
621615
## Hooks & Validators
622616

623617
Hooks are registered centrally in `hooks/hooks.json` (auto-loaded by the plugin

0 commit comments

Comments
 (0)