backnotprop / backnotprop/plannotator

Annotate: frontmatter card shows wrong values when the YAML has nested keys

Open
#1,485 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.7k
Forks
649
Avg merge
11h 12m
Merged PRs (30d)
109

Description

### What happened?

I run `plannotator annotate` on [OKF](https://github.com/GoogleCloudPlatform/open-knowledge-format)-based documents before committing them. Their frontmatter holds nested provenance metadata: who generated the document, who verified it, and which sources back it. The frontmatter card at the top of the annotate view flattens that structure, so child keys from different parents end up next to each other under the wrong names.

Example document:

```yaml
---
type: Fact
title: Markdown code fences
tags:
- markdown
- commonmark
status: stable
generated:
by: claude-code/claude-fable-5-1
at: 2026-09-02T12:05:02+09:00
verified:
- by: human:jaeyeong.yang
at: 2026-09-02T12:11:00+09:00
sources:
- id: commonmark-fences
resource: https://spec.commonmark.org/0.31.2/#fenced-code-blocks
- id: rumdl
resource: https://github.com/rvben/rumdl
---
```

What the card shows:

Image

I expected nested mappings to stay together: `generated` as a group with its own `by` and `at`, and each `sources` or `verified` item as one entry with its fields. If nested rendering is out of scope, showing only the top-level keys and leaving the nested part as raw text would still be better than merging child keys upward.

The card is what I read to decide whether a document is ready: is `verified` filled in, by whom, when, and do the sources cover the claims. Right now it answers those questions wrongly while looking complete, so I end up scrolling to the raw YAML anyway. Any frontmatter with a sub-map such as `author:` or `params:` gets the same treatment.

Related: #43 (frontmatter card), #1101 (block scalars). Neither mentions nested keys.

### Plannotator version

plannotator 0.27.12

### OS

macOS

### Agent

Claude Code

### Where did it happen?

Annotate

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.