Skip to content

Latest commit

 

History

History
222 lines (157 loc) · 15.2 KB

llm-system-dev-multitask.md

File metadata and controls

222 lines (157 loc) · 15.2 KB

System development with Multitask — A MemNet application note

Dialect (product 0.8): GQL only — ../grammar/gql-wire-profile.md. Product shape: ../SHAPE.md. Shared contract: README.md. Do not teach Layer / Tier A. Wire shapes: examples/inverting-amplifier-gql-case-study.md.

Class: applications — downstream system repos (modelbasedPrj-* two-store; SysMLEdgePrj-* when a SysMLEdge desk overlay is present).
Operational doctrine (developers): docs/operations/multi-agent-sessions.md.
Application skill: .cursor/skills/memnet-multitask/ (optional user pack: ~/.cursor/skills/memnet-multitask/). Index: docs/README.md.

Application example (documentation only). Pattern for a downstream system repository when Cursor Multitask Mode (or Task sub-agents) runs multi-step system, software, or SysML work. MemNet stays shared working memory for agents (mission goldfish: TSK_*, locators, campaign pin_map). It is not the structural model graph. Prefix is the model host: modelbasedPrj-* is repo-based (git sysml-models/; MUST NOT use SysMLEdge as model SSOT). SysMLEdgePrj-* is SysMLEdge-based when bound (the SSOT graph is hosted by SysMLEdge).

Dialect: GQL (../grammar/gql-wire-profile.md).

This note complements:

Doctrine pointer: adopt MN-REQ-12 via a short local requirement mirror or doc link — do not import MemNetRequirements from the MemNet product repo into the system project's SysML load tree.


1. Working memory vs model SSOT

MemNet is shared working memory for agents. Chat is never mission SSOT (MN-REQ-12.1; extends MN-REQ-10.1). The structural model has a host mode. Two MCP namespaces, two pin_map tools: MUST NOT substitute.

Store Role SSOT for
MemNet session (shared TCP/HTTP) Campaign goldfish: TSK_*, USR_*, scoped MOD_* / SYM_*, CLM_* / DEC_* Mission ids, paths, task status, agent-verified locators. Not the model graph.
Model host Structural model (requirements, deploy, behaviour, satisfy/allocate) modelbasedPrj-* / this engine: git sysml-models/ (MUST NOT use SysMLEdge as model SSOT). SysMLEdgePrj-* and bound (working_ssot=graph for this projectId): SysMLEdge graph. git sysml-models/ is backup after human Save, not the live graph while bound.
Source tree (parts/, firmware, docs) Git history Code and artefacts on disk

Host mode. Prefix is the host. LLM-facing remains AGENTS.md. This MemNet engine repo is repo-based (no SysMLEdge product face; mustNotInventUploadBind).

Host Who has it Model read / write MemNet
repo-based modelbasedPrj-*; this engine checkout Edit git .sysml. MUST NOT use SysMLEdge as model SSOT. MemNet Snap / relatives are a cache Campaign pin_map / mutate
SysMLEdge-based SysMLEdgePrj-* with product face and rev_status showing this projectId with working_ssot=graph Read rev_status / ask / gql / product pin_map. Write propose. Desk Save is human, not an agent step to finish. Operator README on that overlay states SysMLEdge-based. Campaign pin_map only — not model SSOT

Repo prefixes. modelbasedPrj-* is repo-based by prefix (mission MemNet + git sysml-models/). MUST NOT use SysMLEdge as model SSOT on that family. SysMLEdgePrj-* is SysMLEdge-based when bound (user-sysmledge; its own pin_map; multi-projectId; human-gated openProject). MUST NOT invent projectId. MUST NOT skip the face because the graph lags files. MUST NOT substitute SysMLEdge pin_map for MemNet pin_map (or the reverse). MUST NOT invent an upload/bind this engine overlay forbids. MUST NOT copy a SysMLEdge host onto a modelbasedPrj-* tree.

flowchart TB
  subgraph mission [Shared MemNet session TCP/HTTP]
    TSK[TSK_* parent task]
    USR[USR_* constraints]
    MOD[MOD_* / SYM_* locators]
  end
  subgraph model [Model SSOT host]
    REPO[repo-based: git sysml-models/]
    EDGE[SysMLEdge-based: bound desk graph]
  end
  subgraph workers [Multitask workers]
    W1[Worker scoped mutate]
  end
  PARENT[Parent coordinator] --> TSK
  PARENT -->|delegate + end turn| W1
  W1 -->|campaign pin_map first| mission
  PARENT -->|campaign pin_map reconcile| mission
  PARENT -->|checkpoint: model facts| model
  W1 -.->|repo-based edit or SysMLEdge propose| model
Loading

2. Transport (non-negotiable under Multitask)

Parent and every worker MUST bind to the same GraphStore via TCP serve (MEMNET_MCP_TRANSPORT=tcp, :18765) or streamable-http MCP (:18766/mcp). Default in-process MCP gives each process an isolated graph — MUST NOT use for shared missions (MN-REQ-12.2).

Pattern When
One mission session id Default: parent passes session in every worker prompt
Separate session ids Independent missions only; parent imports a member slice at settle if needed (prefer import over session merge)

Probe with serve_status before delegating if transport is uncertain.


3. Parent coordinator

MUST

  • session_open / session_load one mission id before spawn; pass it in worker prompts.
  • Mint and own TSK_* / USR_*: status=active → status=settled; optional led_to_success edges.
  • Assign write scope (anchor ids + allowed relation types) in self-contained worker prompts.
  • End the turn after background spawn — no poll, no await (MN-REQ-12.6).
  • Next coordinator turn: pin_map first; act from a refreshed slice that still holds load-bearing kinds — filter-out or raise max_rows rather than hard-truncate. If the emit carries a truncation signal (CueConflict family), treat the Shape as incomplete; never claim a complete extract. Do not redo worker investigation from chat.
  • Prefer one worker per coherent workstream; parallel only with disjoint anchors or separate sessions (MN-REQ-12.5).

MUST NOT

  • Settle parent TSK_* from worker chat — only from shared-session pin-map facts.
  • Assume full session ACL modes (private/shared/open + session_token) or pin-map export/round-trip (MN-REQ-12.7; verified by MN-VER-12-S09). RSV and Path-B ingest domains are shipped.

4. Worker agent

MUST

  • Use the parent's session id; pin_map with a real cue when a turn needs memory.
  • Copy assigned ids from a filter-out / high enough pin-map slice — MUST NOT invent ids the parent already minted. If pin_map is clipped at a hard cap, the emit MUST show a truncation mark (same honesty family as CueConflict); treat that as incomplete Shape (FND / checklist / fundamentals must not silently drop).
  • Mutate only under the assigned subgraph (anchors + relations in the prompt).
  • Return a concise result; durable facts live in MemNet rows.

MUST NOT

  • Open a different session unless explicitly assigned.
  • Settle parent-owned TSK_* / USR_* unless delegated.
  • Use in-process MCP when the parent uses shared TCP/HTTP.
  • Hard-truncate a worker pin_map / Shape to fit (M); claim completeness under that window; ignore a truncation mark on the emit; soften engine caps. Tighten cue/filter/scope instead. Wire-flag honesty c MAY follow in a sibling PR; the MUST to mark a clip still holds.

5. Serial SysML then code (recommended)

When work touches both the model host and implementation files:

Order Worker Scope Rationale
1 SysML worker Model qname= / REQ_* / SYM_*. repo-based: MOD_* under sysml-models/. SysMLEdge-based: product pin_map / ask then propose Structural decisions land in the model host first
2 Code worker parts/, tests, firmware Implementation follows model; disjoint MOD_* anchors

Alternative: one worker if the mission is small and files do not overlap.

MUST NOT run two workers on the same anchor slice without serialisation or an RSV lease (last-write-wins if you skip both).

When the SysML parent shell is already clear (children named, session= assigned), sibling interiors are disjoint: one TSK_* per interior session, workers pin_map only that (S_i). If the parent nest is still being invented, stay serial — write the shell first. Detail: llm-sysml-v2-modeling.md (look loop + parallel sub-units).


6. Adopting MN-REQ-12 in a system repo

The MemNet product models Multitask in MemNetRequirements::MN_REQ_12_* and MemNetVerification (MN-VER-12-G00, S01…S09). A modelbasedPrj-* or SysMLEdgePrj-* repo should:

Approach Use
Doc pointer Link docs/operations/multi-agent-sessions.md + this note in AGENTS.md / project rules
Thin local mirror e.g. SYS_REQ_MT_* leaves in product requirements.sysml that restate operational SHALLs — not a git submodule of MemNet SysML
Verify (optional) Product-specific verify cases that verify local reqs and reference MemNet case study — do not duplicate the full MemNet verify package

Do not add import MemNetRequirements::* from the MemNet engine repo into the system load tree unless the project explicitly owns a merged model (rare).


7. Path-B pin ingest

Path-B PinMapIngest_* domains are shipped (MN-REQ-11; #31 / #64):

CLI MCP Locators
memnet ingest sysml --path … ingest_sysml path=, qname= — 1 path → current session (not model Snap)
memnet snap model --root … snap_model catalog session= + qname= — one model → session stack
memnet ingest codebase --path … ingest_codebase path=, line=, signature=
memnet ingest pcba --path … ingest_pcba refdes=, net=, pin=, path=
memnet ingest skills --path … ingest_skills skill_id=, phrase=

SysML load trees: use model Snap, not one ingest_sysml per file and not a truncated pin_map of a fat :contains nest. Application: llm-sysml-v2-modeling.md.

Client leftover NEW mint is leftover, not product. Prefer ingest for bounded pin maps; seed_lines / leftover add remain leftover for one-off locators. Product write is mutate. Ingest is not export. 0.19 cue pin_map GQL write-out is memnet export pin-map; re-ingest later (#66).

Method When
Path-B ingest … Primary: selective artefact → pins
session_open seed_lines Mission start bootstrap without artefact path
leftover add leftover façade for incremental locators after grep/LSP confirm; prefer mutate
leftover id:'NEW' mint leftover engine; product is GraphElement CREATE without NEW

Re-pin_map after ingest/seed; workers copy locators / cue from the shaped slice (labels + observable properties), not nickname ids.


8. Pin taxonomy (system-dev missions)

Prefix Owner Typical use
TSK_*, USR_* Parent Mission task, user constraints
MOD_*, SYM_*, REQ_*, PRT_* Worker under scope Files, symbols, product requirements, parts
CLM_*, DEC_* Worker (GraphElement CREATE; leftover NEW named leftover) Findings, open decisions

Edges: owns, about, constrained_by, led_to_success (parent settle), domain relations from product grammar.


9. Failure modes

Failure Symptom Mitigation
In-process MCP under Multitask Worker writes invisible to parent TCP/HTTP shared store; serve_status
Chat as SSOT Duplicate ids, stale paths pin_map when a turn needs memory; parent reconcile from session
Parent polls / re-investigates Token waste; gate violation End turn after spawn; next turn pin_map only
Parallel same-anchor writers Silent clobber Serial worker or disjoint scopes
Assuming full ACL modes / session_token False isolation CapsPolicy when enabled; RSV + Path-B ingest are shipped; full modes still to-be
SysML vs MemNet drift Model and campaign pins disagree Model host wins for structure (git when repo-based; bound SysMLEdge graph when SysMLEdge-based). MemNet holds locators + mission state
MemNet pin_map as the model graph Agent edits .sysml or settles structure from campaign pins while a bound desk is SSOT Two namespaces: product pin_map / ask / propose for the model; MemNet pin_map for the campaign
Worker settles parent TSK_* Lifecycle violation Parent-only settle unless delegated
Truncating pin_map as the copied slice FND / checklist / fundamentals missing; false-complete extract Filter-out (drop news / tighten cue) or raise max_rows; engine (M) stays a hard reject. Clipped emit MUST carry a truncation signal (CueConflict family); treat as incomplete Shape

10. Open decisions (record in DEC_*)

  • Local IPC vs TCP: LocalIpcGateway is shipped (memnet serve --ipc); choose per host.
  • Whether to add product-specific SYS_REQ_MT_* leaves or doc-only adoption.
  • Single worker vs SysML-then-code split per mission class.
  • Full ACL modes / session_token remain to-be; WorkerWriteScope hard-rejects when session ACL is enabled.

11. Related

Topic Path
Enforceable Multitask doctrine docs/operations/multi-agent-sessions.md
MemNet product MN-REQ-12 model sysml-models/models/requirements.sysml
Verify package sysml-models/models/verify.sysml (MN-VER-12-G00, S01…S09)
Case study sysml-models/outputs/multitask-case-study.md
ACL / reserve (RSV shipped; full ACL modes design) docs/extras/memnet-security-multi-agent.md, memnet-neighbourhood-reserve.md
SysML modeling (single-agent) llm-sysml-v2-modeling.md
Unsync checkpoint pipeline (roles / Bind / gates) llm-unsync-checkpoint-pipeline.md