fix(core): reject timestamp and checkbox-marker observation categories - #1239
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b9b2ff730
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if _TIMESTAMP_CATEGORY.match(category) or _is_task_marker_category(category): | ||
| return None |
There was a problem hiding this comment.
Exclude tagged extended-checkbox tasks
When an extended checkbox task also has a tag, such as - [/] task #work or - [X] done #work, returning no category match is insufficient: is_observation() subsequently detects the hashtag and still emits an observation with category=None. The existing [ ], [x], and [-] checks exclude tagged tasks entirely, so these newly recognized markers should receive the same observation-level exclusion rather than falling through to tag-only promotion.
Useful? React with 👍 / 👎.
Closes #1219. Closes #1241.
Two sibling false-positive classes in the observation recognizer, one PR: the bracket
regex accepted any
[x] contentline whose bracket text had no brackets or parentheses,so (a) transcript timecodes and (b) extended checkbox markers both minted junk
observations.
Commit 1 — timestamp-shaped categories (#1219)
[00:00:11] Speaker: ...minted an observation with category00:00:11— one junk graphrow per spoken transcript line, which matters more now that harness hook capture writes
transcripts into notes. A shared
_observation_category_matchhelper rejects bracketprefixes that are pure clock values (
MM:SS,HH:MM:SS, optional./,fractionalseconds) in both recognition paths:
is_observation: a bare or list-item timecode line is not an observation.parse_observation: a hashtag-promoted transcript line (- [00:00:11] ... #meeting)stays an observation via its tag, but keeps the timecode in content with
category=None.Commit 2 — extended checkbox markers (#1241)
The task exclusion only knew GFM's
[ ]/[x]/[-], so Obsidian's extended vocabularyleaked:
- [/] task→ category/,[>]→>,[?]→?, and GFM-legal[X]→X.The helper now also rejects single-character non-alphanumeric bracket prefixes plus
x/X— the checkbox-marker family — as categories. This is the interim guard untilfirst-class task extraction (#1242) owns these lines.
Deliberately narrow throughout:
[2024],[10:30am],[v1:2],[a],[1],[q]allstill parse as categories (each pinned by test). Lineage: #247/#269, #738/#769.
Verification
the hashtag-promotion path, all five extended markers, and single-char alphanumeric
control cases.
tests/markdown/: 84 passed.tests/services/+tests/repository/: 1081 passed.just typecheck,just lint: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01CPdSXDbYyhyZ1TwgFnpEv8