Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 39 additions & 6 deletions WIP.ExamplesBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ compiles](docs/Documentation/Authoring.md) in Authoring.md.

## State

Of 1,249 `tb` fences in 613 pages, **1,197 are marked `check_build`** and compile, and 52
are `inert` with a recorded reason. **None is undecided**, so the backlog the census measures
is empty. No fence is an `excerpt`. The run takes about 110 s. 33 of the marked samples are
also `check_run`.
Of 1,530 `tb` fences in 749 pages, **1,370 are marked `check_build`** and compile, and 159
are `inert` with a recorded reason (107 of them OLEGuids' method signatures).
**None is undecided**, so the backlog the census measures is empty. No fence is an
`excerpt`. The run takes about 110 s. 88 of the marked samples are also `check_run`.

New marked samples should come from editing pages, not from marking: the unmarked fences
that are left are not programs (see [What cannot be marked](#what-cannot-be-marked)).
Expand Down Expand Up @@ -298,17 +298,50 @@ updates it, which beats a sample that quietly stops demonstrating anything.

Version-controlled exported trees under `test/example-projects/<name>/` --- a `Settings`
file plus `Sources/`, exactly what `node scripts/impexp.mjs export` produces and what `tbrun`
already consumes. Three exist:
already consumes. Three whole ones exist:

| template | references | for |
|---|---|---|
| `console` | stdole, VB (Forms), AppGlobalClassObject | everything by default |
| `packages` | the above plus all eleven other shipped packages | `Reference/Built-In/` and the package tutorials |
| `form` | `console`, a delta | a `check_run` sample that needs a real form: drawing, `Cls`, `Print`, `Scale`, a form property. Never inferred: a fence says `project=form` |
| `contributed-<Package>` | `console`, a delta: one `Settings` referencing one documented TWINSERV package, embedded | `Reference/Contributed/<Package>/` |

(The table is the three whole templates. The deltas over them --- `vb-private`, `cc-private`,
`wnc-private`, `cef-private`, `implicit`, `cef`, `webview2` --- are `TEMPLATE_BASE` in
`scripts/lib/example-batches.mjs`, with `form`.)
`scripts/lib/example-batches.mjs`, with `form` and the `contributed-<Package>` ones, which
`TEMPLATE_BASE` gets from the directories so named.)

**`contributed-<Package>`: packages embedded, not committed.** A project uses a TWINSERV
package by embedding its whole exported tree under `Packages/<symbolId>/`, with a reference
whose `path32` and `path64` are `/Packages/<symbolId>` (an AutoCompleteLib `.twinpack` embeds
AutoCompleteGuids this way). A template commits only that `Settings`; `embeddedPackages`
reads the references, and `fetchEmbedded` in `check_examples.mjs` downloads each package at
the reference's version from TWINSERV into `%TEMP%\tb-twinserv\<id>_<version>.twinpack`,
unpacks it beside, and copies it into every batch staged from the template. The code is not
the repository's to commit: four of the nine ship no licence file, and WinReg embeds WinDevLib,
14 MB.

- **One template per package, because a reader's project references one.** With the nine in
one project, VBA_JSON's `Dictionary` class hid the `Scripting.Dictionary` that WinReg's
samples name.
- **A project does not see the names a package's own references declare.** WinReg embeds
WinDevLib, and its samples' `HKEY_CURRENT_USER`, `REGTYPES` and `BOOL` were unresolved
until `contributed-WinReg` referenced WinDevLib (at the version WinReg embeds, 8.8.0.507)
and the Scripting Runtime itself. The WinReg landing page tells the reader the same.
- **An error inside an embedded package is the package's, and fails nothing**
(`splitPackageFaults`). BigNumberLib 0.0.0.0 and WinReg 0.0.0.0 do not compile on BETA
1005: each passes a pointer to a `ByRef` structure parameter without `ByVal` (TB5001). The
template-alone build finds those rows; the run prints them as a note naming the package
rather than as a template FAIL, every other template row still fails, and the samples are
judged by their own rows as before. Their landing pages say so in a NOTE, and both sections
are excluded from the site until the packages compile; `examples.bat` still compiles their
samples, since it reads every page under `docs/` whatever `exclude:` says.
- **When a section's `indexed_from` moves to a new version, change the version fields in its
`test/example-projects/contributed-<Package>/Settings` with it**, or its samples compile
against the old package. A new contributed section needs a template of its own: a copy of
another's `Settings` with the reference's `id`, `name`, `symbolId`, `path32`, `path64` and
version fields (strings) changed, from the package's own `Settings` and its TWINSERV version.

**Template inheritance.** `TEMPLATE_BASE` names each template's base. The stager copies
base-first, delta-over, so a template holds only the files that *differ*: `vb-private` is
Expand Down
51 changes: 51 additions & 0 deletions WIP.Indexer.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,57 @@ the old tool's at BETA 997, and it takes half a second with no cache.
its 17 values at BETA 997, the first named `" "`, which the committed file lacked until it
was derived again.

## `draft` and the doc-draft workflow

`twin-index draft` turns `report.json` into page plans (`lib/draft-plan.mjs`), and
`indexer/draft/workflow.mjs` is the Claude Code workflow that writes the pages from them.

- **Placement is read from each section, not from a convention**, because the sections do not
share one: the built-in packages keep enumerations in `Enumerations/`, the contributed ones
beside the classes; a class is `X/index.md` with member pages, `X.md` with its members
inline, or `_App/_App.md`. The draft workflow this replaced derived every path from one rule
(`<module>/<symbol>.md`, `<symbol>.md`), which matched no section exactly. Every rule in
`draft-plan.mjs` is a majority over the section's own pages.
- **How well it places, checked by leaving each symbol out** of every section with a store
package (the thirteen built-in and default ones at BETA 997, and the nine contributed ones of
the `contributed-packages` branch) and planning it again: 994 of 998 members land on the file
the section has them on, with its parent and permalink; 138 of 156 types; and the landing
page of each contributed section, planned from the other eight, matches in all nine. The 18
types that miss are layout choices no API shows: six that are the only type of their kind
in their package, with nothing to follow (`AutoComplete.md`, not `AutoComplete/index.md`;
`_App/_App.md`); seven controls laid out unlike their package's other controls; two
`...State` classes kept in their control's folder; CustomControls' `Constants` module, at
the root while its other modules are in `Framework/`; and two collections whose owner's
folder the check had itself taken away. The four members that miss are documented unlike
the others of their kind in their type, or not at all. The rule that places a type in the
folder of the type returning it is limited to folders that already keep a type, because
without that limit it moved Printer under Printers, Dictionary under JsonConverter and
eight others that the sections keep at their roots.
- **A permalink is computed only where the rule holds for every existing page** of the
section (`followsFolders`). On staging at BETA 997 that is every section but VBA's, whose
pages live under `/tB/Modules/`. A section that breaks the rule once gets no computed
permalinks at all, rather than a guess that a sibling page would contradict.
- **The prep is Node and the workflow is thin**, as Wisdom's extract is
([WIP.Wisdom.md](WIP.Wisdom.md)): a workflow script cannot read a file, so everything that
needs the tree --- the pages, their titles and permalinks, the kinds of the types they
document --- is decided by tested code, and the agents get finished decisions. The
manifest passed as `args` names the batch files and nothing more, because `args` is written
out by the calling session, at output-token cost; each agent reads its own batch.
- **No two agents write one file.** A batch is a type with its new members, or one type's
members, and the pages that go on one type's one page are never split across batches. The
lists that several batches would all touch --- the landing page's, and a type page's list of
its members --- are left to one agent per package after its batches finish.
- **The check step compiles before a person reads.** One agent per package runs
`check_examples --only` on the section, at a port of its own (9700 up, clear of the
harness's default 9480), and fixes the pages. A contributed package without a
`contributed-<Package>` template cannot be compiled, and the agent says so.
- **The agents are Sonnet**, as the content agents of the contributed packages were; the
drafts are read against the sources before they are committed, which no model choice
replaces.
- **It is not in the published docs.** `draft` is (Tools-Build), because its plans serve a
person writing pages by hand; the workflow is described here and in `WIP.md`, because
nothing under `docs/Documentation/` may require Claude.

## Open items

- **`diffApi` reports `attributes` as changed as well as `signature` when only a property's
Expand Down
Loading
Loading