A name tells the reader what a file or symbol owns, without opening it. Use the terms of the glossary. One concept has one name. Rename only when the current name misleads or uses a deprecated term. Persisted names and names that a model reads never change.
Parent: manual.
A rename must not change observable behavior. Keep these strings exactly as they are, even when the Python name changes:
- The
__type__values in seeds and checkpoints, for exampleActionSchemaKnoxel. A fixed table inpm.memory.yaml_codecmaps them to the renamed classes. - Tool names that a model sees, for example
ghost_get,ghost_search,ghost_gwt,minecraft_call. - Virtual paths that a model sees, for example
ghost/knoxels/*.yaml. - Workflow names in manifests, for example
minecraft_project. Run receipts store them. - Bus topics, for example
action.request, and persisted field names, for exampletick_id,task_id. - Report schema identifiers, for example
pm.minecraft-project-report.v1. - Runtime locations, for example
.runtime/ghost.json. - Prompt text.
- The runtime lives in
pm/. Behavior lives inworkflows/. Development tools live indev/. Test data lives intest_data/. - Name a runtime package after the API it provides:
pm.memory,pm.llm,pm.runs. - Name a workflow folder after its manifest name:
workflows/minecraft_project/holdsminecraft_project.workflow.md. - Name a workflow library after its shared concept:
public_speech,minecraft_body. - Do not create
utils,common,helpers, ormiscfolders. Put a helper in the narrowest package that owns its concept. - Create a folder only for a real boundary. A folder with one file is acceptable only for a workflow or a stage.
Acceptable: workflows/main_cognition/phases/appraise.py.
Not acceptable: pm_core/utils/datetime_utils.py (one function, generic folder name).
- Name a file after the concept or operation that it owns, as a noun:
tree_store.py,claim_review.py,retrieval.py. - Let the folder give context.
minecraft_body/lease.py, notminecraft_body/minecraft_body_lease.py. - Keep enough context for stack traces and search.
pm/memory/store.pyis acceptable because its import path ispm.memory.store. - These names have a fixed meaning in every workflow folder:
| File | Meaning |
|---|---|
<name>.workflow.md |
The manifest. |
steps.py |
The kernel-side skill with run(context). A large one becomes a steps/ package. |
schemas.py |
Pydantic request, report, and decision contracts. |
host.py |
The host binding: bus module and host-side tools. |
prompts.yaml or prompts/ |
Prompt text. |
resources/ |
Skill text that an agent role reads. |
- Avoid
engine.py,manager.py,handler.py,core.py,base.py,support.py,model.pyunless the package gives them one exact meaning.
| Current | Problem | Target |
|---|---|---|
modules.py |
Every bus module in one file. | One host.py per workflow. |
working_target.py |
"target" means three things. | pm/memory/bash_view.py, pm/host/folder_target.py. |
runtime/models.py |
"model" means the LLM, a schema, or the mental state. | pm/llm/config.py. |
runtime/workflow_models.py |
It holds LLM sessions, not workflow data. | pm/llm/workflow_sessions.py. |
runtime/shell.py |
It clashes with the bash environments. | pm/host/application.py. |
runtime/minecraft_actor.py |
Two different "actors". | workflows/minecraft_body/gateway.py. |
pm_core/model/knoxel_state_change.py |
It holds record types, not state changes. | pm/records/cognitive_records.py. |
workflows/main_cognition/engine.py |
"engine" says nothing. | workflows/main_cognition/stage_runner.py. |
workflows/main_cognition/state_changes.py |
"state" has four meanings. | workflows/main_cognition/cycle_commits.py (A19F renamed it again when the stages went away). |
- Use nouns in
PascalCasefrom the glossary:MemoryStore,WriteBatch,BodyGateway. - Name a record class
<Concept>Record:ActionSchemaRecord,BeliefRecord. The old__type__stays. - Use
Protocolfor a boundary that has more than one implementation. Name it after the capability:WorkingTarget, notIWorkingTarget. - Do not prefix a class with its package name.
pm.memory.Snapshot, notMemorySnapshot. - Name exceptions
<Condition>Error. Keep an exception's existing name when the name is written into saved data.GhostConflictandGhostCancelledkeep their names for this reason:type(error).__name__goes into stored rejection reasons.
- Use a verb for an operation:
classify,commit,replay_dispatches. - Use a noun for a pure query result:
eligible_leaves,dialogue_history. - Prefix a function that performs external I/O with its effect when it is not obvious:
read_journal,observe_conditions. - Do not encode the caller in the name.
scoped_gameplaydescribes the result, not the user.
- Constants use
UPPER_SNAKE_CASE:ACTIVE_STATES,READ_TOOLS. - Define one set of run states in
pm.runs. Other packages import it. - Enumerations use
PascalCaseclass names and the existing member values. - Configuration classes end in
Config:LlmConfig,PersonaConfig.
- A test file mirrors the file it tests:
tests/unit/minecraft_project/test_tree_store.py. - Name a test after the behavior:
test_stale_epoch_cannot_dispatch. - Do not name a test file after a work item. Record the work item in the docstring.
- Captured receipts live in
test_data/captures/<origin>/and keep their source digest.
- Name an adapter after the external system and its role:
mcp_client.py,http_client.py,mcp_listeners.py. - Keep the external system's own names in arguments and payloads.