Skip to content

[DO NOT MERGE] adopt 立意 (liyi) intent spec convention#99

Draft
xen0n wants to merge 1 commit into
loongson-community:mainfrom
xen0n:adopt-liyi-pattern
Draft

[DO NOT MERGE] adopt 立意 (liyi) intent spec convention#99
xen0n wants to merge 1 commit into
loongson-community:mainfrom
xen0n:adopt-liyi-pattern

Conversation

@xen0n

@xen0n xen0n commented Mar 9, 2026

Copy link
Copy Markdown
Member

Summary

This PR proposes adopting the 立意 (Lìyì) convention for making code intent explicit, persistent, and reviewable in AI-assisted development.

What is 立意?

立意 addresses a core problem in AI-assisted development: the gap between "what the human wanted" and "what the AI produced." It makes intent:

  • Explicit: Written in sidecar files (<filename>.liyi.jsonc)
  • Persistent: Version controlled alongside code
  • Reviewable: Humans approve intent separately from implementation

Changes

File Change
AGENTS.md Add 立意 workflow section with full documentation
.liyiignore Project-specific exclusions (node_modules, generated files)
src/node/plugins/loongfans-data/generateDatabase.ts Add @liyi:requirement(data-integrity) marker
src/node/plugins/loongfans-data/generateDatabase.ts.liyi.jsonc Example sidecar with 4 intent specs
docs/liyi-proposal.md Comprehensive adoption proposal

Benefits for loongfans

  1. Safer AI refactoring: The ongoing device pages refactor can leverage documented intent
  2. Better onboarding: New contributors understand "why" behind complex transformations
  3. Review efficiency: Separates "does intent match requirements?" from "does code match intent?"
  4. Long-term maintenance: Intent specs survive when original authors move on

Adoption Plan

  • Phase 1 (this PR): Pilot with documentation and example sidecars
  • Phase 2: Add sidecars for critical functions (chipsPages.ts, devicesPages.ts)
  • Phase 3: Full adoption with CI integration

See docs/liyi-proposal.md for detailed rationale, FAQ, and workflow documentation.

Resources


Note: This is a documentation/convention change. No runtime behavior is affected. The project can adopt 立意 gradually — the linter is optional for local development but can be added to CI later.

@xen0n xen0n changed the title docs: adopt 立意 (liyi) intent spec convention [DO NOT MERGE] adopt 立意 (liyi) intent spec convention Mar 9, 2026
@xen0n xen0n force-pushed the adopt-liyi-pattern branch from 56e5a47 to 805dca9 Compare March 21, 2026 11:24
…viewable

Extend AGENTS.md with 立意 workflow section covering:
- Intent spec sidecar files (.liyi.jsonc)
- Module-level invariants (@liyi:module)
- Triage workflow for stale specs
- JSON schemas for sidecar and triage reports

Add .liyiignore for node_modules and generated files.

Add sidecar specs with correct source spans and hashes:
- generateDatabase.ts: 29 items (9 non-trivial, 20 trivial)
- chipsPages.ts: 11 items (5 non-trivial, 6 trivial)
- devicesPages.ts: 10 items (4 non-trivial, 6 trivial)

Add module doc LIYI.md for src/node/routes documenting
clean build compatibility invariant.

Original prompt:
```plain
check out https://github.com/loongson-community/loongfans, sync latest main branch,
checkout the adopt-liyi-pattern branch, reset to main (yeah abandon the previous work)
and redo the liyi bootstrap with fresh https://github.com/liyi-run/liyi binary.
```

Co-authored-by: kimi-coding/k2p5
@xen0n xen0n force-pushed the adopt-liyi-pattern branch from 805dca9 to 3465b3f Compare March 21, 2026 11:30
@xen0n xen0n marked this pull request as draft April 3, 2026 12:53
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