Repository navigation
fix: resolve 1.3.0-rc.4 estate defects before rc.5 - #680
Merged
Merged
Conversation
…, upgrade guide - Python gen/verify refuse generated Python that does not compile; every port's code writer refuses indented text (ERR_WRITER_LEADING_WHITESPACE), with commentLine() for block-comment lines. - TypeScript gen and verify --codegen parse emitted TypeScript before writing. - A committed legacy .hashes.json is authoritative over a stale ignored .hashes/ in every port (ADR-0064 section 2 corrected). - verify --db names and collapses SELECT * view drift; migrate recreates such views on Postgres when a base table gains columns. - Removed-marker refusal names every generator; service generators skip objects whose entity module the run does not emit; new WARN_DERIVED_COMMAND_BYPASSES_DECLARED in every port's rules gate. - No false git-ignored warning on the run that migrates the manifest. - Prerelease tooling: host redaction, per-lockfile unlink hint, unlink restores the pre-link pins, estate-run restores ignored gen-state, and a full candidate refuses unfolded changelog fragments. - CHANGELOG 1.3.0: fragments folded; Upgrading from 1.2.0 corrected and completed (owned generators, markers, queries primitives, Frag, uuid on every dialect, docsFile/generateSite, hash manifest, formatting churn, Python hooks); migration docs aligned.
…dule the run does not emit
…; export EntityFileWriter - gen and verify refuse any generated file carrying "[object Object]" (ERR_GEN_STRINGIFIED_OBJECT) in TypeScript, Python, C#, Java/Kotlin and Rust, before writing or comparing; the exact quoted string literal stays allowed (the Rust port's emitted query-string encoder uses it). - A TypeScript Frag refuses to become a string (ERR_FRAG_AS_TEXT): an owned 1.2 composer interpolating an engine fragment where ts-poet's Code printed itself now fails at the line that did it. - EntityFileWriter is exported from @metaobjectsdev/codegen-ts/engine. - CHANGELOG 1.3.0: Fixed and upgrade entries; stale claims that ts-poet's joinCode still resolves and that TsWriter accepts Code removed.
…tate-run installs a mixed estate's TypeScript packages
…oks; the api reference names no unwritten entity module The parse check runs jiti's Babel transform, whose rewrite-stack-trace installs a prepareStackTrace wrapper once per process. On Bun that wrapper turns every later ES5-style error (libsql's SqliteError) into 'First argument must be an Error object'. Leaked by the check, it could not be undone by the config loader's own restore, so a meta gen test earlier in the same process failed load-config-global-hygiene in CI. buildApiModel gated only the query helpers on entityModuleCovers, so the reference for a projection whose entity module was filtered out still told readers to import it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
genandverifycompile every emitted.pybefore writing. TypeScriptgenandverify --codegenparse every emitted.ts. The code writers (all ports) reject text that starts with whitespace (ERR_WRITER_LEADING_WHITESPACE).genrefuses output containing[object Object]unless the model itself carries that text. Generated create models enforce cross-field validators andfield.uuidshape (TypeScript, Java, Kotlin, C#, Python)..hashes.jsonwhen it exists, so a stale.gen-state/.hashes/left by another checkout no longer overrides the committed manifest. Hash manifests in C#, Java, Python and Rust recordgeneratedByandsourceNode.requirementsFile()writes onlyrequirements.toon.formatTs, the queriesrender*Fnprimitives and the docs Markdown generator in favour of the code writer andFrag. The classic docs site and the Javamustachegenerator are removed. Python router and extractor hooks take a writer. The changelog fragments are folded into the 1.3.0 section, and the migration docs carry the upgrade steps for these removals. Prerelease scripts (prerelease-link.sh,estate-run.sh,detect-prerelease-pins.sh) and their tests are updated.Validation
Risk Assessment
✅ Low: Since the approved head, the change is small: a scoped restore of the global error hooks, a one-line widening of the API-reference gate (this closes the prior review-1), and documentation and agent-context text. I checked the docs against the runner, service-walk and writer source, and they match.
Testing
Baseline
scripts/ci-local.sh --affected --strict-toolchainsalready passed at the target commit; no source changed here, so broad regression was not rerun. Live: the Python gen and verify refusal of a pre-indented owned generator (D1/D2) passed, and the pin detector no longer leaks the registry host and no longer fails under set -u with MO_REGISTRY_BASE unset (bash 5.1 only) passed. The rest of the 27 intent items were not driven and stay untested. One evidence copy failed (wrong scratch path), so only the D1 transcript is saved.Evidence: D1 python gen refusal transcript
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
♻️ Reviewed only the branch's changes since run 01M8P7Y9664P1KG7YNF58FKH4T approved; the rest of the branch carries that approval.
Findings carried from run 01M8P7Y9664P1KG7YNF58FKH4T, already decided there:
ℹ️
CHANGELOG.md:3071- Inline fix: the unreleased 1.3.0 section still described the removed docs surfaces as present. I corrected three sentences. The Changed entry no longer tells adopters to passdocsSiteFile({ site: "classic" }), which now throws, and now says an owned classic theme is refused. The Java and Kotlin explorer entry (line 756) no longer says the classic site stays TypeScript's. The 'Doc pages are keyed by package' entry (line 3967) no longer namesdocsFile().server/typescript/packages/codegen-ts/src/generators/api-model.ts:344- The latest fix round (4a22ddd) gates onlysurfaces.queriesonentityModuleCovershere, and leavessurfaces.entityrun-wide. TakeentityFile({ filter: entitiesOnly }),queriesFile(),routesFile()andapiDocsFile()over the view-backedOrderView. The run writes noOrderView.ts, butbuildEntityUnitstill pushes themodelsymbolinterface OrderViewwith importPathOrderView. So the API reference tells a reader or agent to import a module that does not exist. The round left the same rule open for every symbol that imports the entity module: the model symbol (if (surfaces.entity)inbuildEntityUnit), the insert and updatevalidationSymbolsfor a writable object the entity filter leaves out, andrelationSymbol. Fix: setentity: surfaces.entity && coversinobjSurfacestoo. The new test at server/typescript/packages/codegen-ts/test/service-file.test.ts:229 hides this, because its import regex matches only.queriesand.routesspecifiers. Widen it to every./import in the reference, so each must be a rendered file.ℹ️
spec/code-writer.md:177- Inline fix: the new Java and Kotlin dialect bullets said "commentLine(parts...)is the TypeScript dialect's". Read literally, that says the method belongs to the TypeScript writer, butJavaWriter.commentLineandKotlinWriter.commentLineboth exist. Both bullets (lines 177 and 210) now say it "works as in the TypeScript dialect: it writes a hand-laid block-comment line".ℹ️
server/typescript/packages/cli/test/unit/emitted-ts-parse-check-hygiene.test.ts:12- The first test can pass without the fix. Babel installs itsprepareStackTracewrapper only the first time it runs in a process.bun testruns the cli test files in one process. If an earlier file (for example a config-loader test that falls back to jiti's Babel) already triggered the installer, this check finds no change whether or not it restores the hooks, so the test cannot reject a leak. The second test (an ES5-style error constructor keeps its message) is the one with a real oracle, and it has the same order dependence. To make the regression reproducible, run the probe in a fresh subprocess (Bun.spawnof a small script that callsemittedTypeScriptProblemsand then constructs the legacy error), or assert thatError.prepareStackTraceis unchanged right after the first Babel call in a fresh process.pin-stage.*scratch directory it had not created. It was one of the stage directories this branch's earlierprerelease-link.shleaked from its own test runs (fixed in this PR by the EXIT trap); nothing outside this task was affected.scripts/ci-local.sh --affected --strict-toolchainsscripts/ci-local.sh --affected --strict-toolchains (baseline, passed earlier, not rerun)python3.12 -m metaobjects.cli gen --config metaobjects.config.yaml on a pre-indented owned generator fixture (scratch venv with pyyaml, PYTHONPATH=server/python/src): exit 1, ERR_WRITER_LEADING_WHITESPACEpython3.12 -m metaobjects.cli verify --codegen on the same fixture: exit 1bash tools/prerelease/detect-prerelease-pins.sh on a scratch consumer project with a private-IP lockfile URL, env -u MO_REGISTRY_BASE: exit 1, redacted output, no set -u failure✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Validation runs
This took two no-mistakes runs. The first validated the whole bundle (its review needed six fix rounds; scope decisions were folded into the run's intent). The second added one fix after GitHub CI went red on the first push: the emitted-TypeScript parse check ran Babel without restoring
Error.prepareStackTrace, which on Bun broke a later legacy-constructor error in the same test process (load-config-global-hygiene.test.ts). It also gated the API reference's entity-module symbols on the module actually being written. Its Test step was approved as an exception: that run drove only part of the intent live, because the first run had already driven the rest.Item B6:
agent/requirements.mdoutput changes on purposeAn estate run flagged two differences in the generated
agent/requirements.md. Both are intended and kept:extendsis read with the resolving accessors (ADR-0039), so its row is reported under the entity that actually exposes it, not the abstract base that declares it. This is what an agent reading the file needs: the entity it would query or generate against.verifydoes not flag a locale-dependent reordering as drift.Regenerating
agent/requirements.mdonce picks up both changes.