Recued
Menu
← Back to recipes

Move a tag

by recued-core v4 84 views

Use “Move a tag” in Recued. Puts a tag inside a different one. Everything recorded under it follows automatically — no transaction is rewritten.

Complete workflow

Ledger book 18 pinned recipes

Use Ledger book in Recued for accounting, double entry, budget, and records. It includes 44 built-in actions and 17 ready-to-run workflows. Actions that change data use Recued's approval controls.

You are viewing one recipe in this workflow. Installing it opens the complete pack so its other recipes and background automations arrive together.

Move a tag
This recipe

Use “Move a tag” in Recued. Puts a tag inside a different one. Everything recorded under it follows automatically — no transaction is rewritten.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v4

Use “The accounts” in Recued. Every account with its id — what you post to, and what anything else in this workflow needs before it can name one.

pack:ledger-bookaccountingaccountsrecords
by recued-core pinned v4

Use “One account” in Recued. Everything the book holds about one account, opened from the Accounts list.

pack:ledger-bookaccountingaccountsdetail
by recued-core pinned v1

Use “The tags” in Recued. Every tag with its id and how deep it sits — the trees you can spend against, and the ids the rest of the pack takes.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “What it all comes to” in Recued. Each currency's balance read exactly, then converted at rates you give and added up.

pack:ledger-bookaccountingcurrencyrecords
by recued-core pinned v3
Show all 18 recipes

Use “Every budget at once” in Recued. All your budgets for a period, each counting everything under its tag — in four queries, however many budgets you have.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v4

Use “How a budget is doing” in Recued. What a budget has left, counting everything under its tag at any depth.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3

Use “What went under a tag” in Recued. Everything spent under one tag, including every tag beneath it, at any depth.

pack:ledger-bookaccountingtagsbudget
by recued-core pinned v3

Use “The lines under a tag” in Recued. Every transaction line under a tag and everything beneath it — the lines themselves, not a total. With a CSV to copy.

pack:ledger-bookaccountingtagsexport
by recued-core pinned v3

Use “Open an account” in Recued. Adds an account to your chart. Its currency is fixed here and every line posted to it inherits it.

pack:ledger-bookaccountingrecordsv2
by recued-core pinned v2

Use “Post an entry” in Recued. One entry, any number of legs, written in a single all-or-nothing transaction. It will not post unless the legs sum to zero.

pack:ledger-bookaccountingdouble-entryrecords
by recued-core pinned v4

Use “Add a tag” in Recued. Adds a tag anywhere in your tree, at any depth. The tag and its place in the tree are written together or not at all.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Tag a month of lines” in Recued. One tree at a time: every line in a period on one page, with a picker in the tag cell.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v4

Use “Tag a transaction line” in Recued. Sets which tags a line belongs to, one per tree. Each tag and every tag above it counts the full amount.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v4

Use “Set a budget” in Recued. A cap on a tag for one period. It counts everything under that tag, at any depth.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3

Use “Delete a tag” in Recued. Removes a tag and everything beneath it. Refuses while anything is still tagged with it.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v4

Use “One budget” in Recued. Open one budget from the list that names it, and read everything recorded about that budget on one page.

pack:ledger-bookbudgetdetailnavigation
by recued-core pinned v1
View pack details, dependencies, and permissions →

The money follows, and nothing is rewritten

"Groceries should sit under Household, not Food." One move, and every transaction ever tagged Groceries now rolls up under Household — because spending points at the tag, and the tag's identity does not change. Not one recorded transaction is touched.

That is the whole reason the tree is stored as ancestry rather than as a path. A path would have to be copied onto every tagged transaction to make rollups cheap, and then this operation rewrites thousands of rows instead of a handful.

⛔ Detach and re-attach land together. One tag.restructure batch, so there is no moment where the tag hangs under both parents or under neither. A half-done move leaves a tag reachable from some ancestors and not others, and every rollup above it disagrees with every other.

⛔ It moves a tag with NOTHING UNDER IT

A tag that has children is refused, and this is a real limit rather than a policy.

Re-attaching a subtree means writing one edge for every (new ancestor × moved descendant) pair — a CROSS PRODUCT of two lists known only while the recipe runs. A recipe has foreach over one array and nothing that pairs two, so that set cannot be produced. Doing it a batch at a time would leave the tree half-moved between batches, which is worse than not offering it.

⚠ This is specifically a cross product, not "anything involving two lists". Folding many rows into one row per key IS expressible — group_by takes an aggregate and budget-board uses it to do every budget in three queries. Grouping collapses one list; a cross product builds a bigger one, and only the second is out of reach.

What to do instead: move the children out first, move the parent, move them back. Tedious and completely safe — every step is one of these.

⛔ Moving a tag into a DIFFERENT TREE is refused. A tree is a dimension — person -> department -> division is one thing, a project tree is another — and a tag that changed dimension would silently reclassify every transaction ever tagged with it. That is a re-tag, not a move.

⚠ Moving a tag under one of its own descendants is refused too. That would make it its own ancestor, and every rollup beneath would recurse.

It needs FULL access at install

⛔ This recipe is DENIED if the pack was installed with write access — pick all. It drives a batch operation whose allow-list contains a delete (tag.restructure — moving a tag deletes its old closure edges), and a batch's risk floor is the union of everything it may do, so the whole operation is classed destructive. write does not grant that.

⚠ The refusal is operation_not_granted at the gateway, which reads like a bug in the recipe rather than a scope you chose at install. It is not something the recipe can detect and explain for you — the denial happens before its first step runs.

How it works 50 steps

Inspect the data fetches, transforms, gates, and output this recipe runs.

Process (50 steps)
■ tag_id trim
Trim whitespace from setting tag id
■ new_parent_id trim
Trim whitespace from setting new parent id
■ has_tag compare
Check if tag id has data
⚠ tag_guard guard
Stop if has tag equals
■ same compare
Check if tag id equals new parent id
⚠ same_guard guard
Stop if same equals
◆ tag recued-core.ledger-book.tag.get
Get tag on ledger book
■ found compare
Check if tag record id has data
⚠ found_guard guard
Stop if found equals
◆ below recued-core.ledger-book.tag_closure.search
Search tag closure on ledger book
■ below_rows default
Apply default
■ below_count count
Count items in below rows
■ is_leaf compare
Check if below count is at most 1
⚠ leaf_guard guard
Stop if is leaf equals
■ has_parent compare
Check if new parent id has data
⚠ parent_required_guard guard
Stop if has parent equals
◆ parent recued-core.ledger-book.tag.get
Get tag on ledger book
skip: step.has_parent equal false
■ parent_found compare
Check if parent record id has data
■ parent_missing all
Check if all conditions are true
⚠ parent_guard guard
Stop if parent missing equals
■ same_root compare
Check if tag record root ref equals parent record root ref
■ cross_root all
Check if all conditions are true
⚠ root_guard guard
Stop if cross root equals
◆ old_edges recued-core.ledger-book.tag_closure.search
Search tag closure on ledger book
■ old_rows default
Apply default
■ old_count count
Count items in old rows
■ old_page_fits compare
Check if old count is at most 100
⚠ old_cap_guard guard
Stop if old page fits equals
■ detachable filter
Filter by condition
■ current_parent filter
Filter by condition
■ already_there count
Count items in current parent
■ already_parent compare
Check if already there is greater than 0
⚠ already_guard guard
Stop if already parent equals
■ detach_ops map
Extract from each item
◆ new_ancestors recued-core.ledger-book.tag_closure.search
Search tag closure on ledger book
skip: step.has_parent equal false
■ new_rows default
Apply default
■ new_count count
Count items in new rows
■ new_page_fits compare
Check if new count is at most 100
⚠ new_cap_guard guard
Stop if new page fits equals
■ attach_ops map
Extract from each item
■ ops flatten
Flatten nested lists in
■ op_count count
Count items in ops
■ batch_fits compare
Check if op count is at most 100
⚠ size_guard guard
Stop if batch fits equals
■ anything compare
Check if op count is greater than 0
⚠ noop_guard guard
Stop if anything equals
◆ post recued-core.ledger-book.tag.restructure
Restructure tag on ledger book
■ detached count
Count items in detach ops
■ attached count
Count items in attach ops
■ card to_summary
Format results as a summary card
▼
Output
summary card
Settings 2 configurable

Configurable at install. Defaults shown — change them anytime in Recued.

tag id setting = [object Object]
new parent id setting = [object Object]

Uses (3 operations)

Pack operation Get tag on ledger book recued-core.ledger-book.tag.get
Pack operation Search tag closure on ledger book recued-core.ledger-book.tag_closure.search
Pack operation Restructure tag on ledger book recued-core.ledger-book.tag.restructure

Trust & control

What installing this recipe would let it do. Recued grants these permissions at install — review them there before approving.

What it's allowed to do

Destructive Pack Ledger book external change
Read: tag.get · No approvalRead: tag_closure.search · No approvalDestructive: tag.restructure · Always asks

About

Tags

pack:ledger-bookaccountingtagsrecordsv3

Details

50 steps 2 configurable settings recipe_id: move-tag