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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
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
86 changes: 86 additions & 0 deletions .changeset/cli-lint-conversion-notices.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
---
"@objectstack/cli": minor
---

feat(cli): `os lint` surfaces ADR-0087 conversion notices — a `conversions` key in `--json` and a printed notice for a human (#12297)

**Machine-contract widening on the `os lint --json` payload.** A consumer that
reads an exact key set from `os lint --json` sees one new key after this change.

## Proposed grade, and why

`minor`, matching the two nearest precedents on this lane rather than the
bug/feature framing: #13347 (adding `code`/`httpStatus` to the CLI's
`--format json` envelope) and the sibling `conversions` change on
`os validate` / `os build` (#12125) were both graded `minor` as additive
members on a published machine-readable surface. Triage graded this card a
`Bug` on declared-not-enforced grounds, and that reading is not in conflict:
restoring a parity contract can still widen a wire surface, and the grade
follows the surface. Nothing here is breaking — no existing key changes
meaning, none is removed, and the `total` / `errors` / `warnings` /
`suggestions` counts are byte-for-byte what they were.

## What was wrong

`os lint` called `normalizeStackInput(config)` with **no options object**, so no
`onConversionNotice` sink existed. The ADR-0087 D2 conversion layer runs inside
that call and always did — `os lint` converted the author's metadata on every
run — but with no sink the notices were never **produced**, in either face. An
anchored count over the whole file said so in one number:

```
grep -cE 'onConversionNotice|conversions' packages/cli/src/commands/lint.ts
0
```

This is the #3782 **parity** class, not the "computed, then dropped" family
(#11643 / #11391 / #11772 / #12047 / #12125): nothing was computed and
discarded, the producer was never wired. It is the exact gap `os build` was in
before #11772 / PR #12079.

`os lint` is one of the three authoring commands the #4409 registry holds to a
single bar, and it was the only one telling an author nothing about a
conversion its own load path had just applied. A conversion notice is the one
advisory class carrying an **expiry** — `retiresIn` names the protocol major
where the old shape stops loading, and five conversions are live today
(protocol 11 and 15). An author or CI job whose only authoring gate is
`os lint` got no signal at all, in either face, until the conversion retired
and their metadata stopped loading.

## What changed

| face | before | after |
| --- | --- | --- |
| console (`os lint`) | nothing | one `⚠` line per notice: the path, `'from'` → `'to'`, the conversion id, and the protocol major it retires in |
| `os lint --json` | no such key | `conversions`: the same structured notices, unconditionally present |
| `os lint --json`, thrown / caught | no such key | what the run had computed — `[]` for a throw at load |

The console wording is `compile.ts`'s, verbatim, so an author who runs two of
the three commands over one tree is told the same thing in the same words. The
`--json` key is the same `conversions` key `os validate --json` and
`os build --json` publish, carrying the same structured entries, so one
consumer reads all three authoring commands the same way.

## What a consumer should know

✅ `conversions` is **always an array** on `os lint --json`, success or
failure, so it can be read unconditionally. Each entry keeps its structured
`conversionId`, `surface`, `from`, `to`, `path`, `toMajor` and `retiresIn`
fields, so a CI job can gate on `retiresIn` without a second run.

⛔ `conversions: []` does **not** mean "this tree converts nothing" on the
caught-error payload — it means the run stopped before the conversion layer
ran. A config that fails to load reports `[]` by construction. Read the
`error` key to tell the two apart.

⛔ A consumer asserting an exact key set on `os lint --json` must add
`conversions` to it. No existing key changed: `total`, `errors`, `warnings`
and `suggestions` count exactly what they counted before, and exit codes are
untouched (errors still exit 1).

Conversion notices are **not** folded into `issues`. `issues` keeps meaning
"something to fix"; an auto-converted key needs no action to keep loading. The
related question raised on #12125 — whether `warnings` and `conversions` should
become one field on the sibling commands — is open and was not settled by the
2026-08-25 ruling, so this change mirrors the shipped sibling shape rather than
merging anything.
74 changes: 71 additions & 3 deletions packages/cli/src/commands/lint.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
import { Args, Command, Flags } from '@oclif/core';
import chalk from 'chalk';
import { bundleRequire } from 'bundle-require';
import { normalizeStackInput } from '@objectstack/spec';
import { normalizeStackInput, type ConversionNotice } from '@objectstack/spec';
import { PROTOCOL_MAJOR } from '@objectstack/spec/kernel';
import { loadConfig, BUNDLE_REQUIRE_EXTERNALS } from '../utils/config.js';
import { computeI18nCoverage, type CoverageIssue } from '../utils/i18n-coverage.js';
Expand DownExpand Up@@ -496,14 +496,65 @@ export default class Lint extends Command {
printStep('Loading configuration...');
}

// [#12297] The ADR-0087 D2 conversion notices this command raises.
//
// ⛔ This is the #3782 PARITY class, NOT the "computed, then dropped"
// family (#11643 / #11391 / #11772 / #12047 / #12125). Nothing was computed
// and discarded here: `normalizeStackInput` was called with no options
// object at all, so no sink existed and the notices were never PRODUCED —
// in either face. `os lint` is the third of the three authoring commands
// the #4409 registry holds to one bar, and it was the only one telling an
// author nothing about a conversion its own load path had just applied.
// That is the exact gap `os build` was in before #11772 / PR #12079.
//
// It bites harder than it reads: a conversion notice is the one advisory
// class carrying an EXPIRY — `retiresIn` names the protocol major where the
// old shape stops loading — and an author whose only authoring gate is
// `os lint` got no signal at all until the conversion retired and their
// metadata stopped loading.
//
// Declared above the `try` so the catch-all exit can read it, under the
// maintainer's 2026-08-25 ruling (#11772/#12047, applied to this field by
// #12125): every failure exit carries the lists the run has ALREADY
// COMPUTED, so the field means the same thing on every exit. The CALL that
// fills it stays below, at the step that owns it — a throw in `loadConfig`,
// above it, reports `[]` honestly.
//
// ⛔ NOT FOLDED INTO `issues`. Whether an auto-converted key should become
// a `LintIssue` — or, on the sibling commands, whether `warnings` and
// `conversions` should become one field — is an open question raised on
// #12125, left unsettled by the ruling there and explicitly withheld by
// that card's implementer. This change had no authority to settle it, so it
// mirrors the shipped sibling shape rather than merging: `issues` keeps
// meaning "something to fix", the notice keeps its structured
// `conversionId`/`surface`/`from`/`to`/`retiresIn` fields, and the
// `total`/`errors`/`warnings` counts keep counting exactly what they
// counted before.
const conversionNotices: ConversionNotice[] = [];

try {
const { config, absolutePath } = await loadConfig(configPath);

if (!flags.json) {
printInfo(`Config: ${chalk.white(absolutePath)}`);
}

const normalized = normalizeStackInput(config as Record<string, unknown>);
// The ADR-0087 D2 conversion layer runs here, inside `normalizeStackInput`
// — it always did. Passing the sink is what makes the rewrites SAYABLE.
const normalized = normalizeStackInput(config as Record<string, unknown>, {
onConversionNotice: (n) => conversionNotices.push(n),
});
// The human face, mirroring the #11772 repair in `compile.ts` verbatim —
// same wording, so an author who runs two of the three commands over one
// tree is told the same thing in the same words.
if (conversionNotices.length > 0 && !flags.json) {
console.log('');
for (const n of conversionNotices) {
printWarning(
`${n.path}: '${n.from}' → '${n.to}' (converted at load; conversion '${n.conversionId}', retires in protocol ${n.retiresIn})`,
);
}
}
const issues = lintConfig(normalized, { sduiManifest: resolveSduiManifest() });

// ── Package docs (ADR-0046) ── collected src/docs/*.md + inline docs:
Expand DownExpand Up@@ -550,6 +601,14 @@ export default class Lint extends Command {
...(hiddenPlatform > 0 ? { hiddenPlatform } : {}),
...(score ? { score: score.score, grade: score.grade } : {}),
issues,
// [#12297] The notices computed at `normalizeStackInput` above. Its
// own key, unconditionally present — the same `conversions` key
// `os validate --json` and `os build --json` publish, carrying the
// same structured notice objects, so one consumer reads all three
// authoring commands the same way. `[]` when nothing converted, never
// absent: a machine consumer keying off presence must not have to
// distinguish "did not convert" from "this command does not tell me".
conversions: conversionNotices,
duration: timer.elapsed(),
}, errors.length > 0 ? 1 : 0);
return;
Expand DownExpand Up@@ -637,7 +696,16 @@ export default class Lint extends Command {
} catch (error: any) {
if (isExitSignal(error)) throw error;
if (flags.json) {
await emitJson({ error: error.message, ...errorCodeFields(error) }, 0, { compact: true });
// [#12297] Whatever the run had reached before the throw, under the
// same 2026-08-25 ruling: `[]` for a throw in `loadConfig` — the
// normalize step never ran — and the notices in hand for any later one.
// Wiring the producer without this exit would ship a fresh instance of
// the #12125 defect one command over, on the day it was closed.
await emitJson(
{ error: error.message, ...errorCodeFields(error), conversions: conversionNotices },
0,
{ compact: true },
);
process.exit(1);
}
console.log('');
Expand Down
Loading
Loading