1. Compile the command
Resolve exact matter identity, package subjects, route, jurisdiction, and one production stage. The output is a fingerprinted intent receipt, not an informal guess.
Engineering training guide
A policy-driven, evidence-producing workflow that turns an authenticated attorney instruction for one exact matter into verified WealthCounsel documents—without quietly crossing into filing, signing, delivery, or client communication.
01 · Mental model
WealthCounsel remains the authoritative legal-document generator for supported real matters. The repository decides what is authorized, translates source facts and attorney intent into a controlled execution plan, preserves artifact lineage, and proves what happened.
Resolve exact matter identity, package subjects, route, jurisdiction, and one production stage. The output is a fingerprinted intent receipt, not an informal guess.
Operate WealthCounsel inside the authorized scope, preserve raw sources, finish exact working copies in licensed Word, and require evidence at each transition.
Assemble the registered package, run technical and semantic QA, optionally upload the authorized files, read them back, and stop before downstream release actions.
02 · How attorneys communicate with the engine
The engine accepts ordinary language—there is no magic command syntax—but an authenticated instruction from Greg Van Horn or an authorized firm attorney must bind one exact matter, communicate draft versus final, and make the intended terminal action clear. Upload is never inferred.
draft or final explicitlyThe engine may echo the exact matter, subjects, route, stage, assumptions, terminal action, and stop boundary. That declarative acknowledgement is notify-and-continue, not a second approval checkpoint.
Focused questions are appropriate for unresolved identity, conflicting stage, missing final signing dates, or a true technical hard stop. When drafting is authorized and the attorney says to proceed through incomplete substantive facts, the engine records provisional choices in the Draft Assumption and Review Note and continues.
This structure improves precision, but natural language is valid whenever it communicates the same facts unambiguously.
Matter: <matter name and exact matter ID when available>
Stage: <draft | final>
Package subjects: <person or people receiving packages>
Route / jurisdiction: <document family and state, if known>
Matter-specific direction: <choices, exclusions, or corrections>
Signing date: <one explicit date per final subject; final only>
Terminal action: <create only | download only | complete draft package and file |
produce finals | produce and file finals | selected-file upload>
Stop boundary: <optional explicit narrower stop>
A named-matter drafting instruction authorizes the WealthCounsel work needed to produce the requested draft set. It does not authorize upload or release.
“Download the docs” is a composite command. It means preserve sources, finish in Word/Ribbon, assemble, watermark, QA, upload the registered draft set, read it back, and stop at DPC-110.
Use the qualifier only. This preserves and hashes the raw WealthCounsel DOCX files, then stops at DPC-20.
A final request requires an approved exact final profile and one confirmed signing date per subject. Plain “produce finals” stops at FPC-90.
Explicit upload language extends the final loop through FPC-100 and FPC-110. The files still go only to the exact Lawmatics matter Files section.
The attorney does not need to name Class A–D. Identify the correction, affected subject/documents, and terminal action. A narrow upload should name the exact files.
| Attorney language | Engine meaning | Default stop |
|---|---|---|
| “Create draft documents” | Draft authority and matter-scoped production; no inferred upload | Before Lawmatics upload |
| “Download the docs” | Full Draft Package Completion Loop, including registered filing | DPC-110 after upload readback |
| “Download only” | Preserve and hash WealthCounsel source DOCX files | DPC-20 |
| “Produce finals” | Final Package Completion through sealed deliverables | FPC-90 |
| “Produce and upload the finals” | Final Package Completion plus explicit Lawmatics filing | FPC-110 |
| “Fix / change / redo / re-download” | Compile sealed rework Class A–D, invalidate stale evidence, then perform the named terminal action | Exact boundary in the correction receipt |
| “Upload only <files>” | Exact selected-file upload; no companion files implied | After duplicate check and readback |
03 · End-to-end lifecycle
The exact handlers differ by route and stage, but this control flow is the stable backbone.
Run npm run verify:handoff. A real matter additionally requires a clean main checkout matching origin/main and a persisted certified-mainline receipt.
Bind the authenticated instruction to the exact Lawmatics matter, package subjects, stage, route, terminal action, upload scope, and stop boundary. Keep workflow authority separate from execution capability and credential availability.
Source precedence is direct instruction → reviewed plan → attorney note. Paid-service metadata and questionnaires support the decision but cannot independently create a trust-bearing route.
Resolve exactly one of draft or final. That decision binds the workflow, output set, assembly profile, source mode, watermark rule, and QA obligations.
Normalize matter, people, roles, fiduciaries, beneficiaries, contacts, jurisdiction, and source facts. Surface conflicts. Record every provisional choice in the running review note.
Load one Layer 2 family contract, choose its exact route variant, and expand it into a versioned per-subject component manifest. Spouse and client data remain isolated.
Verify the practice, reuse or create contacts duplicate-safely, select only approved parent answer sets, enter and read back controls, generate, and preserve the exact source set.
Raw DOCX files are immutable evidence. All cleanup and finishing happens on exact, isolated, job-owned copies with hashes linking source to output.
Open each job copy in licensed Microsoft Word, run the WealthCounsel Ribbon contract, save, close, reopen, then prove zero unresolved cross-references, processing instructions, repair prompts, and visible artifacts.
Convert verified DOCX files independently, remove only structurally proven blank pages, assemble the registered order, apply a draft watermark only when required, and run technical plus route-semantic QA.
The manifest binds every selected artifact to its subject, source lineage, post-Word hash, assembly evidence, QA results, and stage-specific output set.
When explicitly authorized, upload duplicate-safely to the exact Lawmatics matter Files surface, immediately verify remote identity and content, issue the receipt, classify learnings, and stop.
04 · Architecture
The repository deliberately separates authority from how-to guidance and implementation. This prevents a helpful skill, old test, or historical note from silently becoming production policy.
Policies and registries answer questions true for every document: authority, stages, route support, upload destination, Word finishing, output sets, watermark, QA, and stop gates.
policies/registries/registries/control-plane.json
Exactly one family contract defines the route-specific variants, client shape, confirmed component membership, candidate components, and release-manifest eligibility.
contracts/families/<familyId>.json
Skills explain how to perform a route or platform task. They link to policy and family sources; they are not a second authority or status layer.
skills/wealth-counsel-engine/SKILL-INDEX.md
JavaScript modules compile intent, enforce receipts, orchestrate resumable steps, manage locks and leases, validate evidence, and invoke purpose-built adapters.
engine/scripts/
Lawmatics supplies matter-scoped facts and the final Files destination. WealthCounsel generates the legal documents. Licensed Word and the WealthCounsel Ribbon materialize and verify production DOCX files.
Lawmatics · WealthCounsel · Microsoft Word
A receipt is a tamper-evident contract between steps. It carries the exact policy fingerprint, matter and subject bindings, artifact hashes, and decision inputs. If a parent artifact or policy changes, downstream evidence becomes stale instead of being silently reused.
05 · Stage-specific completion loops
They share the same mandatory Word/Ribbon finishing contract, but they do not share source assumptions, assembly profiles, output sets, or watermark behavior. “Download the docs” invokes the full draft loop; “download only” stops at DPC-20. “Produce finals” stops at FPC-90; final filing requires explicit upload language.
DPC-10 through DPC-110
DPC-10Resolve exact matter, clients, and package subjects.DPC-20Download, preserve, and hash WealthCounsel sources.DPC-30Apply only registered non-substantive edits on working copies.DPC-40Complete licensed Word and WealthCounsel Ribbon finishing.DPC-50Save, close, reopen, and run post-Word QA.DPC-60Export PDFs and remove only proven blank pages.DPC-70Assemble the registered draft package order.DPC-80Retain the sealed base; create the separately watermarked combined draft.DPC-90Run technical and semantic QA; seal the upload manifest.DPC-100When authorized, upload exact finished deliverables to Lawmatics.DPC-110Read back every remote file, issue the receipt, and stop.FPC-10 through FPC-110
FPC-10Bind final stage, exact subjects, route profile, and confirmed signing dates.FPC-20Populate/read back date controls, prove source freshness, preserve and hash.FPC-30Apply registered deterministic processing to final-labeled copies.FPC-40Complete the same licensed Word and Ribbon sequence.FPC-50Reopen and run final-stage identity, date, TOC, notary, and artifact QA.FPC-60Export PDFs and remove only structurally proven blank pages.FPC-70Assemble the exact approved final page/component order.FPC-80Prove all dates, inserts, page order, and zero watermark.FPC-90Seal finished DOCX files and one unwatermarked final PDF per subject.FPC-100Only when separately authorized, upload the exact final set or requested subset.FPC-110Read back final files, issue the filing receipt, and stop.06 · Evidence and artifact lineage
The engine does not treat “the document” as one mutable file. It carries a chain of distinct artifacts so source preservation, deterministic processing, and release evidence remain independently auditable.
07 · Safety and stop semantics
The engine distinguishes uncertainty that should be made reviewable from technical or identity conditions that make reliable production unsafe.
Every provisional decision records basis, confidence, affected documents/sections, and the attorney action needed.
mainFake people, synthetic adapters, no WealthCounsel. npm test and verify:handoff prove code and policy invariants.
It does not decide whether an authorized live run may start.
Used to prove live UI and document behavior without a client matter. Identity and session safety still matter.
Starts only from certified production mainline. Authorized drafting proceeds through uncertainty; true hard stops and downstream gates remain intact.
08 · Rework
Once generation has begun, ordinary attorney language such as “fix,” “change,” “redo,” or “re-download” is not a new first draft. The attorney should identify the target, correction, affected subject/documents, and intended terminal action; the engine then seals one edit class so it knows what evidence to invalidate and where the completion loop may resume.
Wrong executor, shares, ages, powers, legal language, scenario, or package membership.
Path: return to exact WealthCounsel parent answer sets, regenerate, invalidate seals, and start fresh at DPC-20 for reissue.
Only allowlisted, non-substantive formatting or spacing corrections.
Path: preserve raw source, mutate isolated working copies, repeat Word/Ribbon and post-Word QA.
Rebuild order, redo draft watermark, or re-upload selected valid finished files.
Path: verify parent hashes, then resume at the earliest still-valid assembly or upload step.
Wrong person, spouse swap, client binding, or answer set tied to the wrong subject.
Path: issue an identity event, invalidate downstream evidence, then run the Class A regeneration path.
09 · Route envelope
Always read registries/route-support.json at runtime. The table below is a training snapshot of the registry’s 2026-08-26 state, not a substitute for the canonical file.
| Route | Family | Draft status | Operational meaning |
|---|---|---|---|
simple-will-individual | Simple Will | Supported with accepted exception | Controlled, matter-specific production; surface the registered DPA exception in review. |
simple-will-couple | Simple Will | Pending production validation | Attorney-authorized drafting only; New Jersey is the default registered variant. |
testamentary-trust-individual | Testamentary Trust Will | Pending production validation | Attorney-authorized drafting; exact final profile exists for the registered New Jersey individual route. |
testamentary-trust-couple | Testamentary Trust Will | Pending production validation | Attorney-authorized drafting; Connecticut remains a provisional draft variant with its own final-processing profile. |
revocable-living-trust-individual | Revocable Living Trust | Pending production validation | Attorney-authorized drafting; finals require a current-source freshness decision and new unwatermarked assembly. |
mapt-joint | Medicaid Asset Protection Trust | Pending production validation | Attorney-authorized drafting; matter-specific substantive choices remain essential. |
mapt-individual | Medicaid Asset Protection Trust | Pending production validation | Attorney-authorized drafting; tested examples are not firm-wide substantive defaults. |
college-young-adult | College / Young Adult | Pending production validation | Attorney-authorized drafting inside the registered three-document envelope. |
deed-transfer | Deed and Property Transfer | Production prohibited | Contract-mapped future-state lane; source packet, route, jurisdiction, and package remain unresolved. |
10 · Engineering code map
Start from the policy or registry that owns the question, then follow the control plane to its enforcing engine module.
engine/route-intent.jsRanks source authority, prevents trust escalation from metadata, selects the family/route, and binds the family manifest.
engine/document-production-intent.jsCompiles exactly one stage and binds its workflow, output set, watermark, final profile, and downstream false flags.
engine/family-contracts.jsLoads the single Layer 2 family contract and resolves the exact client-shape variant and component status.
engine/production-wealthcounsel.jsRuns the guarded live WealthCounsel sequence: source/form binding, identity checks, contacts, parent entries, interview controls, generation, and download.
engine/draft-package-completion-executor.jsExecutes resumable DPC-10 through DPC-110 handlers with step evidence and sealed manifests.
engine/final-package-completion-executor.jsExecutes the final-stage handler contract and refuses draft-executor or generic-profile fallback.
engine/draft-correction-intent.jsCompiles natural-language rework into Class A–D receipts, invalidations, and the permitted resume point.
engine/word-ribbon-finishing.jsValidates the universal production DOCX finishing receipt and its exact post-Word hash binding.
engine/firm-document-assembly.jsResolves registered draft/final views, component/page order, insert membership, and assembly constraints.
engine/lawmatics-client-files-policy.jsValidates exact file selection, Word receipts, stage evidence, matter Files destination, idempotency, and readback.
scripts/run-production-wealthcounsel.jsProduction entry point for one absolute private job JSON and one external verified live runtime module.
npm run verify:handoffRuns the repository-wide contract suite: family projections, tests, security, policies, production workflow, support registry, and source gates.
11 · Team training checklist
verify:handoff proves the repo but does not authorize a live writeMatter + exact matter ID and require immediate readback