Schema: action parameters and results

Đang mở
#13 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng cách đọc schema action có cấu trúc hiện có và các path kiểm tra tham chiếu hoặc lint; issue không nêu tên file hay test nào. So sánh cách các field của action được mô hình hóa và hiển thị, sau đó làm rõ liệu inputs và reports có thuộc phạm vi hay không, bao gồm cả việc validation các entity không xác định. Công việc được xem là hoàn tất khi contract đã thống nhất được biểu diễn và kiểm tra mà không dựa vào phần diễn giải bằng văn bản.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

The gap

An action is {name, actor, preserves, description}. There is no way to declare what an action takes or what it reports back, so any contract about an action's output lives in freeform description text.

Motivating example, from modeling a diagram tool. Three separate decisions in one modeling session turned out to be about action results, and none of them was declarable:

  • Deleting a container recurses, and the result lists every node removed.
  • Deleting a shape converts bound arrow endpoints to free points, and the result warns about each conversion.
  • Dropping a stored overlap expectation as a side effect of a delete is reported in the result.

Each is a "no surprises" contract: the caller learns everything the operation did. Today each is a sentence inside an invariant or a description, for example:

- id: container-delete-recurses
  statement: >-
    Deleting a `Container` deletes its whole subtree. The
    operation's result lists every node removed.

The rule (preserves can point at it) and the report shape (nothing can) are fused into one prose statement.

Possible shape

Optional inputs and reports lists on the structured action form, each entry a name plus a type (primitive, enum, or entity name). This is deliberately short of a full signature language; the value is that the report contract becomes a checkable, renderable part of the model rather than prose. Lint could warn when a reports entry names an unknown entity, matching existing reference checks.

This may be over the line of what a plain-language modeling tool wants to carry; filing it as a data point from real usage rather than a firm request.

Workaround today

Prose in invariant statements and action descriptions.

Ngôn ngữ chính
Go
Star
32
Fork
5
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stacklok/modelith

Tất cả issue của stacklok/modelith

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.