Skip to content

feat(compiler): auto-generate Lexicon from MEL ActionSpec #268

Description

@eggplantiny

Summary

MEL 컴파일러가 ActionSpec.input.fields에서 Lexicon(θ-role 매핑 테이블)을 자동 생성하도록 한다.

Motivation

현재 Intent IR 파이프라인에서 Lexicon은 수작업으로 작성해야 한다:

// apps/taskflow/src/lib/lexicon.ts — 이걸 사람이 써야 함
create  createTask (THEME→title, BENEFICIARY→assignee)
move  moveTask (TARGET→taskTitle, DEST→newStatus)

MEL에 이미 모든 정보가 있다. compileMelDomain()의 결과에서:

  • action name → lemma 변환 (createTaskcreate)
  • field name → θ-role 매핑 (assignee → BENEFICIARY, dueDate → time)

이 매핑이 자동화되면 "MEL만 주면 에이전트가 작동하는" 루프가 완성된다.

Proposed Approach

1. Action name → lemma (접미사 strip)

createTask → create
updateTask → update
softDeleteTask → delete
moveTask → move

2. Field name → θ-role (naming convention)

id, *Id        → TARGET
title, name    → THEME
assignee, owner → BENEFICIARY
*Date, deadline → TimeSpec
status, *Status → DEST
description    → INSTRUMENT
tags, labels   → SOURCE

3. API

import { compileMelDomain, generateLexicon } from '@manifesto-ai/compiler';

const { schema } = compileMelDomain(melText);
const lexicon = generateLexicon(schema);
// → { create: { intentKind: 'createTask', roleMap: { THEME: 'title', ... }, timeField: 'dueDate' }, ... }

Impact

  • TaskFlow의 수작업 lexicon.ts 삭제 가능
  • 새 도메인에서 MEL만 작성하면 Intent IR 파이프라인 자동 작동
  • Manifesto의 비전 ("AI가 도메인을 생성/수정/발전") 달성의 핵심 조각

References

  • Intent IR SPEC v0.2.0 (archived at docs/archive/intent-ir/SPEC-v0.2.0.md)
  • Translator SPEC v1.0.3 (archived at docs/archive/translator/translator-SPEC-v1.0.3.md)
  • TaskFlow Intent IR MVP: apps/taskflow/src/lib/lexicon.ts, resolver.ts, lower.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3Priority: later or parking lotenhancementNew feature or requestpkg:codegenOwning package: @manifesto-ai/codegenstatus:deferredStatus: intentionally deferred or parked

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions