Repository navigation
Conversation
…ms declare, typed messages
A second and a third Django project need what a first one's plugin would
otherwise hold alone, so it is here, apart from any of them.
orm.plugin.DjangoCodeMapPlugin is the walk: read the packages, take models,
writes, values and conditions from bamboo.codemap.orm, map raw UPDATE text to
a model by its table, assemble. A subclass states its map id, where a
checkout keeps each package (a package under src/ is still spelled
<package>/<path>, as calls.Types spells a file) and its own boundaries
through module_context / visit_module / visit_node / finish.
The walk also reads the rows other systems declare:
* NEIGHBOURS, package -> system. A model a module imports from a neighbour's
models module (orm.schema.models_declared_elsewhere) is known by the import
-- its class and module, not its fields or table. The write forms attribute
to it as to any model, taking only a field named like a state and only where
the class is certain, and the write is an outbound shared_table boundary
named by the class, ai.models.Proposal, with the fields written. Before,
such a write read as "?.status", unresolved.
* SCHEMAS, schema -> system. A statement's text naming a table of a schema
another system owns, FROM "{PANDA_SCHEMA}"."jobsactive4", is an outbound
shared_table boundary schema.table with the verbs used and the columns the
text quotes. The schema an f-string fills in is the one value its name has
in the module, else in the corpus.
msgdispatch reads messages told apart by a type they carry: a send to a
/queue/ or /topic/ is an outbound message boundary named by the destination
with a MessageEdge per type sent; a class that hands a message to
_handle_<msg_type> is an inbound one named by the queue its module declares,
with a MessageReceiver per type and its handler. The names are a Convention,
so code with other names is read by the same rule.
Everything is recorded in the fields a map is made of -- BoundaryNode's
interface, calls_out, handed_over, carried_values and operations,
MessageEdge, MessageReceiver -- and nothing of it in a convention of its own,
so the map of another system can be bound to it without knowing these tools.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A plugin shipped with bamboo was registered by a branch of _register_builtins,
so two maps added apart both edited the same lines of the factory. A package
whose __init__ holds
CODE_MAP_PLUGIN = ("<map id>", "<module>:<class>")
is now found on first lookup, and its class is imported only when that map is
asked for. Adding a map is adding its package. The PanDA plugin is
registered as before.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 24, 2026
Draft
Draft
Draft
Draft
This branch has not been deployed
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.
Merge order
This PR: merge first. It needs nothing. #50, #51 and #54 are built on it and carry its two commits until it is merged. #53 does not depend on it.
Merging one of #50, #51, #54 before #52 would bring #52's commits in with it; the rest then still merge cleanly. All five were merged together in a scratch branch with no conflict.
Summary
What a second and a third map need that a first one's plugin would otherwise hold alone. Follows the shared ORM recognizers (#37): tools apart from any plugin.
orm.plugin.DjangoCodeMapPlugin— the walkReads the packages, takes models, writes, values and conditions from
bamboo.codemap.orm, maps rawUPDATEtext to a model by its table, assembles. A subclass states its map id, where a checkout keeps each package, and its own boundaries throughmodule_context/visit_module/visit_node/finish. A package undersrc/is still spelled<package>/<path>, ascalls.Typesspells a file.The walk also reads the rows other systems declare:
NEIGHBOURS, package → system. A model imported from a neighbour's models module is known by the import: its class and module, not its fields or table. A write of it is an outboundshared_tableboundary named by the class (ai.models.Proposal) with the fields written. Before, such a write read as?.status, unresolved.SCHEMAS, schema → system. A statement naming a table of a schema another system owns (FROM "{PANDA_SCHEMA}"."jobsactive4") is an outboundshared_tableboundaryschema.tablewith the verbs used and the columns the text quotes.msgdispatch— messages told apart by a type they carryA send to a
/queue/or/topic/is an outboundmessageboundary named by the destination, with aMessageEdgeper type sent. A class that hands a message to_handle_<msg_type>is an inbound one named by the queue its module declares, with aMessageReceiverper type and its handler. The names are aConvention, so code with other names is read by the same rule.factory— a plugin package declares itselfin a package's
__init__underbamboo.codemapis found on first lookup; the class is imported only when that map is asked for. Two maps added apart touch no file in common. PanDA's plugin is registered as before.Everything is recorded in the fields a map already has (
BoundaryNode,MessageEdge,MessageReceiver), so another system's map can be bound to it without knowing these tools.Changes
bamboo/codemap/orm/plugin.py(new),orm/schema.py(DjangoModel.elsewhere,models_declared_elsewhere),orm/writes.py(a model declared elsewhere takes fields named like a state)bamboo/codemap/msgdispatch.py(new)bamboo/codemap/factory.pytests/test_codemap_django_walk.pyTest plan
pytest tests/test_codemap_django_walk.py tests/test_codemap_orm.py— 27 passedscripts/mypy_ratchet.py check— 0 errors; black and ruff clean on the touched files🤖 Generated with Claude Code