Skip to content

feat: add explicit decision relations to FLG - #44

Merged
dlxeva merged 8 commits into
masterfrom
agent/decision-relations-v0
Aug 12, 2026
Merged

feat: add explicit decision relations to FLG#44
dlxeva merged 8 commits into
masterfrom
agent/decision-relations-v0

Conversation

@dlxeva

@dlxeva dlxeva commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds a small, file-backed decision relation layer to FLG.

  • adds four explicit relation types: supersedes, supports, conflicts_with, and depends_on
  • adds relation flags to flg decision add
  • rejects malformed CLI IDs and references to decisions missing from the formal ledger
  • preserves valid IDs while reporting malformed values in human-edited relation declarations
  • shows outgoing, incoming, and malformed relation data in flg trace
  • reports malformed values, unknown targets, and self-references in flg doctor
  • adds bilingual Markdown parsing, focused tests, and a v0 design note

Why

FLG already has durable decision IDs, provenance episodes, and a human-readable ledger. This adds explicit links between judgments without introducing a graph database or a second source of truth.

D-006 --supersedes----> D-004
D-006 --supports------> D-003
D-006 --conflicts_with> D-005
D-006 --depends_on----> D-001

Design boundaries

  • DECISIONS.md remains the source of truth.
  • Relations are parsed deterministically from Markdown.
  • Superseded decisions remain in history.
  • A relation does not automatically mutate decision status.
  • Decision Relations v0 targets existing D-* formal decisions only.
  • Broader dependencies and derived_from remain conceptual or evidence-provenance relationships in v0.
  • No LLM inference, embeddings, graph database, RDF, or new runtime dependency is introduced.

Example

flg decision add \
  --decision "Ship the manifest-first context mode" \
  --rationale "It preserves continuity under bounded context budgets" \
  --supersedes D-004 \
  --supports D-003 \
  --conflicts-with D-005 \
  --depends-on D-001,D-002

flg trace D-006
flg doctor --strict

Validation

  • 198 tests passed locally
  • repository smoke test passed
  • git diff --check passed
  • CI passed on Python 3.10, 3.11, and 3.12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 109e39e45d

ℹ️ 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".

Comment thread src/flg/core/relations.py Outdated
end = matches[index + 1].start() if index + 1 < len(matches) else len(content)
block = content[match.start():end]
graph[source] = {
relation: _extract_ids(_relation_value(block, labels))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report malformed relation values instead of dropping them

When the human-editable ledger contains a mistyped relation such as - **Depends On:** D-99O, _extract_ids returns an empty list, so both flg trace and flg doctor --strict treat the declaration as if no relation existed. Because DECISIONS.md is authoritative and may be edited outside decision add, parsing should preserve or report non-empty malformed relation values rather than silently discarding them.

Useful? React with 👍 / 👎.

@dlxeva
dlxeva merged commit 11c337d into master Aug 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant