/logic-discovery
finds answers in Logic Bee
Questionβ
Using exact document, button or table name helps the agent find it faster. Be as specific as possible
Stacked questionβ
Stacking questions in discovery offers more opportunity for cross-domain understanding
Groundingβ
Adding grounding for the model to first understand the context and then search
Primingβ
Priming with context means pre-loading, understanding, then moving to the task
Multiple tasksβ
Stacking tasks help provide more accurate guidance when the complexity is high
Examplesβ
Thought1s
The user asked how voiding a posted customer invoice works. Start from MCP, not the filesystem.
I'll map documents, statuses, and downstream hooks, then ask whether to dig deeper.
Worked for 1m 12s
Voiding a customer invoice is a terminal undo of a posted receivable: the invoice is marked Void, its ledger impact is reversed with a new journal entry, and the related sales orderβs invoiced quantities....
....
Void invoice β upstream and downstream
Subject hook finance-invoices/void-invoice. No other hook calls it. The only wired trigger is FLOW finance/finance.void-invoice from the Customer Invoices void row button.
Source: hook_graph upstream / downstream / references / action + project_graph journey Β· 2026-09-04
Graph
Solid = direct. Dashed = via action or published event. Subject node uses accent fill.
Full journey plus FLOW sibling job 2. Dashed = executeAction or persistent event.
finance-journal-entries/ensure-journal-entries-for-invoicehookDirect executeHook. After status is void, this is the journal-reversal owner (line 200).
apps/api/src/app/hooks/finance-journal-entries/ensure-journal-entries-for-invoice/ensure-journal-entries-for-invoice.finance-journal-entries.hook.ts
Documents this chain touches
| Document | Role | Via |
|---|---|---|
finance/invoice | Read + write data.status β void | finance-invoices/void-invoice |
shipping/billOfLanding | Read linked BOLs; detach pre-ship; block post-ship | finance-invoices/void-invoice |
sales/order | Rewrite quantityInvoiced / quantityLeftToInvoice / invoiceStatus | inventory-management/update-shipping-and-invoicing-statuses |
finance/journalEntry | Create posted reversal; patch original with reversal id | finance-journals/reverse-journal-entry |
finance/journalEntryWithItems | Read original items; persist reversal items | get / create journal entry with items |
data.journalEntryId is not on FinanceInterface.Invoice. Journal linkage is through journal documents, not an invoice-side id field.
What void-invoice owns vs refuses
Guards before any write
| bad_request if |
|---|
| Invoice not found |
| Payments recorded |
| Credit memos applied (unapply first) |
| Linked BOL is en-route, delivered, completed, or exception |
| Invalid payment / reconciliation state |
Does not own
| Left to another flow |
|---|
| Credit-memo un-apply β blocks instead |
| Payment reversal β blocks instead |
| Period-lock enforcement β not owned here |
| Post-ship billing correction β credit memo, not void |
Edges in current view (17)
| From | Kind | To | Via action |
|---|---|---|---|
| Finance | NAVIGATES_TO | Customer Invoices | β |
| Customer Invoices | NAVIGATES_TO | void | β |
| void | CANVAS_CONNECTS_TO | Void invoice | β |
| Void invoice | FLOW_HAS_JOB | Job 1 Β· Void invoice | β |
| Void invoice | FLOW_HAS_JOB | Job 2 Β· Publish event | β |
| Job 1 Β· Void invoice | JOB_RUNS_EVENT | void-invoice | β |
| Job 2 Β· Publish event | JOB_RUNS_EVENT | publish-persistent-event | β |
| publish-persistent-event | PUBLISHES_EVENT | post invoice | β |
| void-invoice | executeHook | ensure-journal-entries-for-invoice | β |
| void-invoice | executeHook | update-shipping-and-invoicing-statuses | β |
| ensure-journal-entries-for-invoice | executeHook | reverse-journal-entry | β |
| ensure-journal-entries-for-invoice | executeHook | get-journal-entry-with-items | β |
| ensure-journal-entries-for-invoice | executeHook | create-journal-entry-with-items | β |
| reverse-journal-entry | executeAction | get-journal-entry-with-items | finance/finance.retrieve-data-entry-for-journal-entry |
| reverse-journal-entry | executeAction | create-journal-entry-with-items | finance/finance.create-data-entry-for-journal-entry |
| create-journal-entry-with-items | executeHook | calculate-journal-entry-with-items | β |
| create-journal-entry-with-items | executeHook | compute-fiscal-period-metrics | β |
Evidence grades: empty hook upstream, FLOW trigger, two direct executeHook edges, reverse via ensure, and SO quantity rule are VERIFIED. Why job 2 publishes post invoice, and whether fiscal-period compute can refuse a closed period on void, remain UNKNOWN. Sibling voids (bill, credit memo, journal entry) are out of this graph.
Checking how a document is usedβ
Understanding the usage of a stream keyβ
Confirm the typeβ
Name type when you know it. Omit type when the problem is not named. The skill asks.
Name type
Pick a pathβ
The skill starts broad. It shows a short map of documents, hooks, and domains.
Pick the path to narrow. After every answer the skill asks whether to dig deeper, and on which path.
Worked for 1m 12s
Map. Named documents, statuses, and downstream hooks. No proposed change.
Ask whether to dig deeper, and on which path.
Void a posted customer invoice
Source: MCP `flow_documents`, `hook_graph` β start `finance-invoices/void-invoice`.
Do not propose a change. Ground names in MCP spelling.
| Document | Path | Statuses |
|---|---|---|
| Invoice | finance-invoices/invoice | posted β voided |
Ask whether to dig deeper, and on which path.
Hold the factsβ
VERIFIED. Document path finance-invoices/invoice. Status posted β voided. Hook finance-invoices/void-invoice.
Stop. question answered. Deeper research is optional.
The skill labels each claim VERIFIED | INFERRED | UNKNOWN.
It keeps MCP spelling byte-for-byte. It does not invent names.
Prefer the conversation.
Persist {slug}-discovery.md when a file helps.
When type is requirement or feature, persist {slug}-requirments.md if /logic-plan needs a file.
That filename is the skill spelling.
| Type | Stop when |
|---|---|
bug | Divergence located. No cause. No fix. |
feature / requirement | Inventory of documents and hooks. Open questions listed. |
idea | Feasibility and conflicts. No build plan. |
question | Question answered. Offer deeper research. |
If MCP tools are not visible, the skill stops. Do not grep for what MCP owns.
question and idea stop the pipeline. Do not start /logic-plan for those types.
Next stepsβ
When type is bug, feature, or requirement, run /logic-plan.