feat(parse): extract forge refs from task body

Problem: `parse.body()` had no awareness of forge link tokens, so
`gh:user/repo#42` stayed in the description instead of metadata.

Solution: add `forge_ref` field to `pending.Metadata` and extend the
right-to-left token loop in `body()` to call `forge.parse_ref()` as
the final fallback before breaking.
This commit is contained in:
Barrett Ruth 2026-03-10 17:44:10 -04:00
parent 46b87e8f30
commit 3a3e5b0505

View file

@ -6,6 +6,7 @@ local config = require('pending.config')
---@field rec? string
---@field rec_mode? 'scheduled'|'completion'
---@field priority? integer
---@field forge_ref? pending.ForgeRef
---@class pending.parse
local M = {}
@ -596,7 +597,17 @@ function M.body(text)
metadata.rec = raw_spec
i = i - 1
else
break
local forge = require('pending.forge')
local ref = forge.parse_ref(token)
if ref then
if metadata.forge_ref then
break
end
metadata.forge_ref = ref
i = i - 1
else
break
end
end
end
end