-
Notifications
You must be signed in to change notification settings - Fork 3
feat(family-mongo): add live introspection and wire CLI commands #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wmadden
merged 38 commits into
main
from
tml-2233-m4-online-cli-commands-live-introspection
Apr 14, 2026
Merged
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
49e0bd7
Add M4 execution plan for online CLI commands and live introspection
wmadden 95c3321
feat(mongo-adapter): implement live schema introspection
wmadden 49feb2a
feat(family-mongo): wire introspect() on MongoControlFamilyInstance
wmadden e8fb4bb
feat(family-mongo): implement toSchemaView for MongoSchemaIR
wmadden db910d6
refactor(cli): generalize inspect-live-schema for non-SQL families
wmadden 1a7a070
test(integration): add db schema end-to-end test for Mongo
wmadden 4b69861
feat(family-mongo): implement verify() for marker-only verification
wmadden b7ba16c
feat(family-mongo): implement schemaVerify() for live schema diffing
wmadden 640fa06
feat(family-mongo): implement sign() with CAS marker write
wmadden 432dc09
test(integration): add db verify + db sign end-to-end tests for Mongo
wmadden 6c59b8d
extract schema diffing logic from control-instance.ts into schema-dif…
wmadden b40ceb1
clean up control-instance.ts and introspect-schema.ts
wmadden 9e60d01
add unit tests for diffMongoSchemas covering strict mode and all elem…
wmadden a9e39af
add unit test for inspect-live-schema non-SQL path
wmadden df73184
add Mongo CLI e2e tests for db schema, db verify, and db sign
wmadden 33322e1
fix lint and typecheck errors in schema-diff.ts
wmadden 8cc5d13
fix toSchemaView root label from "contract" to "database"
wmadden f7fa8ea
improve db schema tree display for Mongo
wmadden a7988dc
remove meaningless default type param from SchemaViewCapable
wmadden 5b7762c
fix profileHash omitted from migration plan destination and verify er…
wmadden 6f93fe2
fix runner reads profileHash from contract, not migration plan
wmadden 8ee4e1f
promote MongoSchemaIR from plain interface to proper AST node
wmadden 71ddfdf
extract toSchemaView conversion logic to schema-to-view.ts
wmadden 05c6dc2
promote SchemaTreeNode from interface to frozen class
wmadden 0dffb27
make SchemaViewCapable generic and declare implements on families
wmadden 92b3c2c
replace conditional spread patterns with ifDefined utility
wmadden 966e2e1
extract verify error codes to shared framework constants
wmadden 275edc0
add TODO(TML-2253) for marker-ledger query AST migration
wmadden 6120512
fix typecheck errors in introspect-schema
wmadden fc97bb0
move marker-ledger from adapter to driver layer, replace findOne with…
wmadden 3d334c0
add agent-agnostic rule: prefer aggregate over obsolete find/findOne
wmadden 0e76e45
rewrite marker-ledger to use query AST commands instead of raw driver…
wmadden 484657e
move marker-ledger to target package where it belongs
wmadden 62d0ccb
fix(F11): remove = unknown default from ControlFamilyInstance, requir…
wmadden fb2404d
fix: address CodeRabbit review findings
wmadden df67496
fix: resolve CI failures — missing type args, lint, and e2e assertion
wmadden 7a48bfa
fix: remaining CI failures — unused imports, snapshot label, TS2379 e…
wmadden 30a5699
harden mongodb-memory-server setup across the repo
wmadden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # MongoDB: no obsolete commands | ||
|
|
||
| MongoDB's `find` and `findOne` are legacy commands from older MongoDB versions. The MongoDB product team considers them obsolete. | ||
|
|
||
| ## Use `aggregate` instead of `find`/`findOne` | ||
|
|
||
| ```typescript | ||
| // BAD — obsolete command | ||
| const doc = await db.collection('foo').findOne({ _id: id }); | ||
|
|
||
| // GOOD — modern aggregate pipeline | ||
| const docs = await db | ||
| .collection('foo') | ||
| .aggregate([{ $match: { _id: id } }, { $limit: 1 }]) | ||
| .toArray(); | ||
| const doc = docs[0] ?? null; | ||
| ``` | ||
|
|
||
| For multiple documents, use `aggregate` with `$match` (and `$sort`, `$skip`, `$limit` as needed) instead of `find().sort().skip().limit()`. | ||
|
|
||
| ## `insertOne`, `findOneAndUpdate`, `findOneAndDelete` are fine | ||
|
|
||
| These are standard CRUD operations and are **not** obsolete. Continue using them directly. |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.