Skip to main content

/logic-discovery

finds answers in Logic Bee

Question​

/logic-discovery
How does voiding a posted customer invoice work?

Using exact document, button or table name helps the agent find it faster. Be as specific as possible

Stacked question​

/logic-discovery
What is a inventory movement? How does stock interact with movement? Which hook calculates stock?

Stacking questions in discovery offers more opportunity for cross-domain understanding

Grounding​

/logic-discovery
<ground> @calculate-sales-activity.hook.ts </ground> Explain how this is used

Adding grounding for the model to first understand the context and then search

Priming​

/logic-discovery
<prime> @my-secret-plan.md </prime> <task> Calculate blast radius </task>

Priming with context means pre-loading, understanding, then moving to the task

Multiple tasks​

/logic-discovery
<prime> @user-request-for-sales-order.md </prime> <ground> @calculate-sales-order.hook.ts </ground> <task_1> Calculate blast radius of @user-request-for-sales-order.md </task_1> <task_2> Considering the current state surgically extract implications of future state </task_2>

Stacking tasks help provide more accurate guidance when the complexity is high

Examples​

/logic-discovery
How does voiding a posted customer invoice work?
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....

....

Create a canvas explaining to upstream and downstream

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

0Hook callers (upstream)
1Triggering FLOW
2Direct executeHook
7Transitive hook nodes

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.

Financeui
Customer Invoicesui
voidui
Void invoiceflow
Job 1 Β· Void invoicejob
Job 2 Β· Publish eventjob
void-invoicesubject
publish-persistent-eventhook
post invoiceevent
ensure-journal-entries-for-invoicehook
update-shipping-and-invoicing-statuseshook
reverse-journal-entryhook
get-journal-entry-with-itemshook
create-journal-entry-with-itemshook
calculate-journal-entry-with-itemshook
compute-fiscal-period-metricshook
finance-journal-entries/ensure-journal-entries-for-invoicehook

Direct 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

DocumentRoleVia
finance/invoiceRead + write data.status β†’ voidfinance-invoices/void-invoice
shipping/billOfLandingRead linked BOLs; detach pre-ship; block post-shipfinance-invoices/void-invoice
sales/orderRewrite quantityInvoiced / quantityLeftToInvoice / invoiceStatusinventory-management/update-shipping-and-invoicing-statuses
finance/journalEntryCreate posted reversal; patch original with reversal idfinance-journals/reverse-journal-entry
finance/journalEntryWithItemsRead original items; persist reversal itemsget / 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)
FromKindToVia action
FinanceNAVIGATES_TOCustomer Invoicesβ€”
Customer InvoicesNAVIGATES_TOvoidβ€”
voidCANVAS_CONNECTS_TOVoid invoiceβ€”
Void invoiceFLOW_HAS_JOBJob 1 Β· Void invoiceβ€”
Void invoiceFLOW_HAS_JOBJob 2 Β· Publish eventβ€”
Job 1 Β· Void invoiceJOB_RUNS_EVENTvoid-invoiceβ€”
Job 2 Β· Publish eventJOB_RUNS_EVENTpublish-persistent-eventβ€”
publish-persistent-eventPUBLISHES_EVENTpost invoiceβ€”
void-invoiceexecuteHookensure-journal-entries-for-invoiceβ€”
void-invoiceexecuteHookupdate-shipping-and-invoicing-statusesβ€”
ensure-journal-entries-for-invoiceexecuteHookreverse-journal-entryβ€”
ensure-journal-entries-for-invoiceexecuteHookget-journal-entry-with-itemsβ€”
ensure-journal-entries-for-invoiceexecuteHookcreate-journal-entry-with-itemsβ€”
reverse-journal-entryexecuteActionget-journal-entry-with-itemsfinance/finance.retrieve-data-entry-for-journal-entry
reverse-journal-entryexecuteActioncreate-journal-entry-with-itemsfinance/finance.create-data-entry-for-journal-entry
create-journal-entry-with-itemsexecuteHookcalculate-journal-entry-with-itemsβ€”
create-journal-entry-with-itemsexecuteHookcompute-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.

Question

Name type

  1. Abug
  2. Bfeature
  3. Cidea
  4. Drequirement
  5. Equestion
type: question

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.

DocumentPathStatuses
Invoicefinance-invoices/invoiceposted β†’ voided

Ask whether to dig deeper, and on which path.

Dig deeper on finance-invoices/void-invoice.

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.

TypeStop when
bugDivergence located. No cause. No fix.
feature / requirementInventory of documents and hooks. Open questions listed.
ideaFeasibility and conflicts. No build plan.
questionQuestion 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.