Repository navigation
Commit e175479
docs(service-analytics): the source comments state the ruled deny for a deployment with no security service (#22299)
Part of #22279
Clause-②: no
This is the source-comment half of #22279: comments only, plus the patch
changeset their published text needs. The release-owned text is in the
docs-only PR #22296. The card stays open until both PRs have merged.
## Why
Maintainer ruling B on #22235 (`6056824332`, 「同意」, 2026-10-08),
verbatim: "**B — deny, as measured, becomes the declaration.** On a
deployment with no security service the analytics read bridges deny,
fail-closed, as they do today; the bridge comments and the header of
`admission-bridge-resolution.test.ts` say so; the "absent admits"
sentence in the released text is corrected by a docs card, since that
text is release-owned."
PR #22276 (`58707166f`) rewrote the bridge comments in `plugin.ts` and
the test header to that ruling. The comments here are the ones its
acceptance notes listed outside its fence. Each one equated "no provider
wired" with "a deployment with no security service" and said such a
deployment keeps its analytics behaviour. Through
`AnalyticsServicePlugin` a provider is always wired, either the host's
own or the bridge. On `ObjectKernel` and `LiteKernel` the lookup of a
`security` service that was never registered throws, so the bridges take
UNUSABLE and refuse the query, fail-closed.
The new text follows the `plugin.ts` wording on `main`. ⛔ It does not
say the ABSENT branch denies. ABSENT is described as reached only by a
context that answers the lookup with nothing (the package's test doubles
do, and no in-repo kernel does). Whether ABSENT itself should deny is
not ruled.
## What changed (comments only)
Line positions are at base `58707166f`.
| File | Site | Listed on the card? |
|---|---|---|
| `read-admission.ts` | module header, *Fail direction*, `:51-65`. The
ABSENT bullet is replaced by three bullets: the declared deny on a
deployment with no security service, the ABSENT context, and a host that
constructs `AnalyticsService` with no provider. The lead-in "but closed
is a claim about a WIRED provider" goes. | yes (`:59-65`) |
| `analytics-service.ts` | `AnalyticsServiceConfig.admitObjectRead` doc,
`:842-845` | yes |
| `analytics-service.ts` | `AnalyticsServiceConfig.getReadableFields`
doc, `:862-866` | yes |
| `analytics-service.ts` | `assertReadAdmitted` doc, `:1899-1901` (the
card's `:1897-1899`) | yes |
| `field-read-admission.ts` | `assertCallerMembersJudgeable` header,
`:338-341` | yes (`:339-341`) |
| `analytics-service.ts` | the `[#20917]` field-level read gate doc,
`:1922` "A no-op when no provider is wired (no security service)". It
documents `assertFieldsReadable` but sits detached, directly above the
member-shape gate's doc. | **added** |
| `analytics-service.ts` | `assertCallerMembersResolvable` doc, `:1935`
"that gate is a no-op with no security service" | **added** |
| `analytics-service.ts` | `assertDatasetFieldsJudgeable` doc, `:2061`
"which stands down with no security service" | **added** |
| `read-scope-refusal.ts` | `readScopeUnresolvedError` doc, `:96-99`: "a
deployment with no security service … is reported loudly at init, and it
must keep running unscoped exactly as before" | **added** |
### The four added sites (bounded in-place fix, declared here)
The card listed four sites, taken from PR #22276's acceptance notes. A
census of the package's `src/` for the same claim, `git grep -n -i 'no
.?security.? service'` outside `__tests__`, found four more. Three are
in `analytics-service.ts`, a file this card already holds. The fourth is
the row-scope sibling of the read-admission header. All four meet the
four conditions: the same defect class as the card, a mechanical
rewording to a shape the ruling already fixed, the same gates, and no
other claim on the file (`read-scope-refusal.ts` is in none of the 12
open PRs' file lists, which were read during this run before the edit).
Leaving them would keep the claim alive twenty lines below the doc this
PR corrects. Reviewer: if you want any of them out, say which and it
comes back in a patch round.
## Proof that only comments moved
For each of the four files, `ts.transpileModule` with `removeComments:
true` gives byte-identical output for the base file and for this head:
```
read-admission.ts base=8a4829c31e94d58c/1351 head=8a4829c31e94d58c/1351
analytics-service.ts base=8dd74af6788b7660/65291 head=8dd74af6788b7660/65291
field-read-admission.ts base=9be45d2722f380cd/5145 head=9be45d2722f380cd/5145
read-scope-refusal.ts base=badef6b1c177459d/233 head=badef6b1c177459d/233
```
(sha256 prefix / bytes.) Positive control: the same comparison over
`read-scope-refusal.ts` with `err.status = 500` changed in memory to
`501` reports the stripped outputs as different.
## Changeset: `patch` for `@objectstack/service-analytics`, not
`skip-changeset`
AGENTS.md: published means what `files[]` ships, and this package ships
`["dist","README.md","CHANGELOG.md"]`. After a rebuild of the package
(under the verify lock), the edited JSDoc is in the published output:
- "That is not a deployment with no security service" (the two
`AnalyticsServiceConfig` docs) is in `dist/index.d.ts` and
`dist/index.d.cts`.
- "without `admitObjectRead`. `AnalyticsServicePlugin` always wires one"
and "no-op with no field reader wired" (class-member docs) are in all
four of `dist/index.{js,cjs,d.ts,d.cts}`.
- "a deployment that registers NO security service denies" (the module
header) is in `dist/index.d.ts` and `dist/index.d.cts`.
- Control for that reading: the `read-scope-refusal.ts` phrase "their
lookup throws on the never-registered name" is in 0 files, because a
non-exported function's doc is not emitted. A runtime string from
`plugin.ts` is in 2 files.
The published `@objectstack/service-analytics@17.6.0` tarball carries
the old sentences in the same files. "the deployment has no security
service, which" and "keeps its pre-existing analytics behaviour" are in
its `index.d.ts` and `index.d.cts`. "A no-op when no provider is wired:
that is a deployment with no security" is in all four. So this diff
changes published bytes and takes a `patch`:
`.changeset/22279-analytics-absent-security-comments.md`.
This differs from PR #22276, which carried `skip-changeset`. Its
`plugin.ts` comments sit inside a function body, measured at 0 files
under `dist/`. Here the comments are on an exported interface and on
class members, which the build keeps.
## Verification (head `7fb9cee98`)
- `@objectstack/service-analytics` was built under the verify lock: its
dependency closure, then the package itself. `check-dts-emitted` found
"2/2 declared declaration file(s) present".
- `pnpm --filter @objectstack/service-analytics typecheck` exits 0.
- `pnpm --filter @objectstack/service-analytics exec vitest run
--maxWorkers=2`: "Test Files 180 passed (180)", "Tests 4443 passed | 262
skipped (4705)". These are the same counts PR #22276 recorded.
- Gates: `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derives **58** commands. Each was run with
its exit code captured before any pipe. **57 exit 0.** **1 is NOT
MEASURED**: `pnpm check:dual-build-cjs-loads` exited 3, `PREREQUISITE
NOT MET`, because 65 workspace packages have no `dist/` in this
worktree. A targeted substitute reading: `require('./dist/index.cjs')`
of this package loads, with 17 exports and `AnalyticsServicePlugin` a
function. `dispatch-gates --ran` gives: "58 derived, 57 run, 1
NOT-MEASURED, 0 UNRUN."
- Named results: `check:dts-closure` reports 75/75 declaration files
across 15 built packages. `check:sourcemap-no-sources-content` reports
105 maps across 15 packages, none embedding source.
`check:published-files`, `check:nul-bytes` (10246 tracked files, no raw
control bytes), `check:doc-authoring`, `check-empty-changeset` ("1
declaring changeset(s) added") and `check:lean-entry-closure` all exit
0. Locally, `check-changeset-no-major` reads its clause-② level axis as
not applicable, because there is no `pull_request` payload. CI reads
this body's `Clause-②: no`.
- Lint, narrowed: `eslint --no-inline-config --format json` over the 4
touched source files reports 4 files, 0 errors and 0 warnings. The
config's only global ignores are `node_modules`, `dist`, `build`,
`.next` and `.turbo`, so all 4 files are in scope. The config never
enables type-aware linting (no `parserOptions.project` in
`eslint.config.mjs`), so this diff cannot change the verdict on a file
it does not touch. The repo-wide `pnpm lint` is left to CI.
## Acceptance notes
- Not here, per the card: the runtime UNUSABLE log text ("A security
service is wired on this deployment") in `plugin.ts` and
`read-admission.ts`, and any change in behaviour.
- Two test titles still say "no security service" for a double that
answers the lookup with nothing. One is the describe at
`admission-absence-report.test.ts:199`, the other the tier label at
`caller-member-column-reference-gate.test.ts:109`. Test names are
outside this comments-only fence. Noted, not filed. Carrier: none.
---
_Generated by [Claude
Code](https://claude.ai/code/session_0115N1oNnQS5WqofZ2DzaT3q)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 98cce87 commit e175479
5 files changed
Lines changed: 63 additions & 29 deletions
File tree
- .changeset
- packages/services/service-analytics/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 21 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
844 | | - | |
845 | | - | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
846 | 849 | | |
847 | 850 | | |
848 | 851 | | |
| |||
861 | 864 | | |
862 | 865 | | |
863 | 866 | | |
864 | | - | |
865 | | - | |
866 | | - | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
867 | 872 | | |
868 | 873 | | |
869 | 874 | | |
| |||
1896 | 1901 | | |
1897 | 1902 | | |
1898 | 1903 | | |
1899 | | - | |
1900 | | - | |
1901 | | - | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
1902 | 1909 | | |
1903 | 1910 | | |
1904 | 1911 | | |
| |||
1919 | 1926 | | |
1920 | 1927 | | |
1921 | 1928 | | |
1922 | | - | |
| 1929 | + | |
| 1930 | + | |
1923 | 1931 | | |
1924 | 1932 | | |
1925 | 1933 | | |
| |||
1932 | 1940 | | |
1933 | 1941 | | |
1934 | 1942 | | |
1935 | | - | |
| 1943 | + | |
1936 | 1944 | | |
1937 | 1945 | | |
1938 | 1946 | | |
| |||
2058 | 2066 | | |
2059 | 2067 | | |
2060 | 2068 | | |
2061 | | - | |
2062 | | - | |
2063 | | - | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
2064 | 2072 | | |
2065 | 2073 | | |
2066 | 2074 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
340 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
341 | 343 | | |
342 | 344 | | |
343 | 345 | | |
| |||
Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
0 commit comments