Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions docs/05-type-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ returned to a caller holds no type-expression node, unless it was parsed with
each would only add memory, 2.4 MB on the `validate` workload's `service`
configuration. Read only `value` and `position`, which both forms have.

`BaseShape.type_written` records authored type syntax during declaration decoding,
before resolution or unwrap, and survives `clone`/`clone_detached`. Scalar type
names and multiple-inheritance sequences are explicit, as are accepted `type:`
and `schema:` fields even when their value is null. A bare empty/null declaration
or a mapping with only inferred facets has no authored type. This fact is distinct
from the resolved kind or the presence of bound expression references.

## 2. Kinds and facets

| Kind | Kind-specific facets |
Expand Down
4 changes: 4 additions & 0 deletions docs/13-public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ Consumers must honor these contracts:
partial: the expression's `value` and `position`, not a YAML `Node`. With
`retain_source` it stays the `Node`. Read only `value` and `position`
(docs/05 § 1).
6. `BaseShape.type_written` records whether a declaration supplied type syntax,
independently of its resolved kind or expression references. Cloning preserves
it; bare empty/null declarations are inferred, while an explicit `type:` or
`schema:` field is authored even with a null value (docs/05 § 1).

Parsing, `build_graph`, `build_occurrences`, `Linter` runs, `to_openapi`, and
the `lsp` verb raise the garbage collector's full-collection threshold while
Expand Down
13 changes: 10 additions & 3 deletions docs/15-implementation-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ XML Schema external types are unsupported ([01](01-scope-and-coverage.md) § 3).
**Service baseline acceptance and recovery.** The simpler source-cache branch
passes the master-controlled rebuild and mixed-request checks after sharing its
query source owner. The user accepted its documented first-use trade-off;
CI verification and integration are pending.
all CI checks passed and the baseline is merged. The first isolated recovery
experiment implements model-backed declaration inlays against that accepted
control. Its correctness, scaling and A/B results are recorded in the
[inlay recovery report](reports/2026-10-10/service-model-inlays.md). The user
accepted its snapshot-first mixed allocation-peak trade-off. Remaining recovery
candidates are shared semantic/hierarchy indices and outline caching, cursor-local
source lookup, and accurate authored section ranges, each measured independently.
The record-backed representation replacement remains parked; its recurring
rebuild and first-use costs are recorded in the
[service cost review](reports/2026-10-10/service-authoring-cost-review.md).
Expand Down Expand Up @@ -75,8 +81,9 @@ the media-type fixes and the type-walk work landed together:
owner removes the old duplicate hover/structural tree. The accepted baseline's
remaining first-use cost and post-query allocation trade-off are recorded in the
[integration report](reports/2026-10-10/service-baseline-integration.md).
Model-backed declaration inlays and cursor-local source lookup are the next
separately measured recovery candidates.
Model-backed declaration inlays remove that first-use work from hints alone;
their accepted request-order peak trade-off is recorded in the inlay recovery
report. Cursor-local source lookup remains a separately measured candidate.

## 3. Potential future work

Expand Down
17 changes: 15 additions & 2 deletions docs/21-language-service.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ the TCK's 1011 files.
`parser:` limits. It keeps the YAML trees too, `retain_source=True`, only when
an enabled lint rule reads them; no rule in the default set does. Decoders
record the small syntax facts that `deprecated-schemas` reads (docs/18 § 6).
The first query that needs a file's tree composes it on demand. Hover, inlays,
The first query that needs a file's tree composes it on demand. Hover,
folding and selection share the workspace's source owner when their input and
composition policy agree (§ 4). Parsing does not populate that query cache or
retain all producer trees. Snapshot-local hover indices keep requested trees;
snapshots borrow the workspace's cache weakly rather than keep its other files
alive. Without a live owner, a held snapshot can compose its own retained text.
It records the set of files it read: every retained text, every
Inlays read model facts and typed data without requesting a tree (§ 4.4).
A snapshot records the set of files it read: every retained text, every
fragment, and every include it tried, found or not. It is built when a query
first asks for it and kept until one of those files changes. A file that
appears, a buffer opened or a file created, also drops every snapshot that
Expand Down Expand Up @@ -350,6 +351,18 @@ returns hints only within the requested source range. It reuses hover's
authored source sites and typed `DataNode` token index, and never resolves a
name or repeats type matching in the adapter.

The decoder's `type_written` flag distinguishes explicit type syntax from
inference. Declaration hints read per-file authored model subjects and expression
spans, without composing source or populating source grammar/built-in indices.
Inferred hints need a real single-line key span; a fragment-root body span is not
an authored declaration key. Reference hints still use the authored expression
span in that fragment.

Expanded YAML aliases keep their anchor's child spans. Declaration hints omit
those borrowed children, including nested object and array members, while keeping
any declaration hints authored at the anchor itself. This check reads model
placement and owned declaration edges; it does not build the source grammar.

A declaration without an authored type can show its inferred type, such as
`[object]`. Explicit built-in types and multiple-inheritance lists are not
repeated. Named type references show the underlying effective type
Expand Down
42 changes: 40 additions & 2 deletions docs/reports/2026-10-10/service-baseline-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,43 @@ against that accepted baseline, without accepting record capture.

## 3. Selective recovery

Pending acceptance of the production baseline. The first planned experiment is
model-backed declaration inlays and `type_written`, without record capture.
All production-baseline CI checks passed, including Linux, Windows, pure-Python
YAML, TCK and benchmarks. [PR #2](https://github.com/deiteris/FastRAML/pull/2)
merged at `bb6941fce593082a4b38a33f4b346dc35268a8d9`. This exact revision is the
comparison control for the first recovery experiment.

### 3.1 Model-backed declaration inlays

Branch: `perf/service-model-inlays`, based on the accepted baseline. Objective:
remove the whole-file grammar/source construction that inlays currently request
just to identify authored types and declaration sites. This does not port shared
semantic indices, accurate outline sites or the record-backed representation.

The decoder records whether a declaration supplied its type; clones preserve the
fact. A bare empty/null declaration is inferred, while an authored `type:` key
(including its null value) is explicit syntax. The existing hover subject/sites
index supplies declarations, with per-URI subject references to avoid scanning
the whole model for each queried file. Inferred labels require an authored
single-line key; fragment-root body spans must not become invented declaration
keys. Named-reference hints continue to use the model's type-expression span.

Expected work: one boolean slot/assignment per shape and clone, one per-URI
subject reference per distinct authored site when hover is first populated, one
hint construction per declaration in the queried file/snapshot, then range
lookup. Inlays should make zero source compositions or grammar/built-in-token
index populations. Typed-value navigation remains lazy and shared as before.

Acceptance compares `inlays`, both mixed request orders, ordinary parse/validate
and routine `large/service` against `bb6941f`. A reach test must forbid source
construction during both timed and allocation inlay passes. Behavior cases cover
explicit versus inferred syntax, multiple inheritance, cloning, included types
and template materializations. Preserve the remaining gates and record the
allocation cost of the new model flag, even when time stays within noise.

The isolated port and measurements are now recorded in the
[inlay recovery report](service-model-inlays.md). Cold inlay time falls 27.4%,
peak 34.8% and retained allocation 30.2%; recurring rebuild time stays within
noise. A 10.0% snapshot-first mixed peak increase is attributed to query-order
allocation overlap, with final retention effectively unchanged. After the
shared-snapshot/order explanation, the user explicitly accepted that new trade-off
and instructed integration on 2026-10-10; normal CI verification gates the merge.
Loading
Loading