Skip to content

docs: add classfile resource specification#2697

Open
aofei wants to merge 1 commit into
goplus:mainfrom
aofei:classfile-resource-spec
Open

docs: add classfile resource specification#2697
aofei wants to merge 1 commit into
goplus:mainfrom
aofei:classfile-resource-spec

Conversation

@aofei
Copy link
Copy Markdown
Member

@aofei aofei commented Apr 1, 2026

Add doc/classfile-resource-spec.md to define the resource model for XGo classfile frameworks.

The specification now defines discovery-based resource introduction over project-scoped pack documents, work classfile-implied top-level resources, and static tool semantics for typed resource references.

This also updates doc/classfile-spec.md to define pack directives, pack roots, and pack documents as the standardized discovery substrate for classfile resource semantics.

Fixes #2704
Updates #2719

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the XGo classfile resource specification, which defines the syntax and semantics for resources in XGo frameworks, including metadata declaration, catalog document formats, and static analysis rules. The review feedback identifies an improvement opportunity in the EBNF notation section, suggesting that the ClassExt production should use a formal comment block for its description to adhere to standard conventions.

Comment thread doc/classfile-resource-spec.md Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.08%. Comparing base (df19f4a) to head (f067091).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2697   +/-   ##
=======================================
  Coverage   94.08%   94.08%           
=======================================
  Files          32       32           
  Lines       10061    10061           
=======================================
  Hits         9466     9466           
  Misses        425      425           
  Partials      170      170           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aofei aofei force-pushed the classfile-resource-spec branch 7 times, most recently from e4a2663 to 85ca110 Compare April 8, 2026 11:21
@aofei aofei marked this pull request as ready for review April 8, 2026 11:23
Copilot AI review requested due to automatic review settings April 8, 2026 11:23
@aofei aofei force-pushed the classfile-resource-spec branch from 85ca110 to 6b04078 Compare April 8, 2026 11:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a formal resource model spec for XGo classfile frameworks and aligns the base classfile spec terminology to support that model (including introducing the “project document” concept used for discovery).

Changes:

  • Add doc/classfile-resource-spec.md defining resource kinds, canonical reference types, DQL-based discovery, scope bindings, and tool semantics.
  • Clarify and tighten terminology in doc/classfile-spec.md (project/work file kinds, base class, work prototype type) and document the project document shape.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
doc/classfile-spec.md Adds/clarifies key terms and specifies the shared JSON “project document” used by resource discovery.
doc/classfile-resource-spec.md Introduces the full resource semantics specification for classfile frameworks (bindings, discovery, scoping, and tooling rules).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread doc/classfile-spec.md Outdated
Comment thread doc/classfile-resource-spec.md Outdated
Copy link
Copy Markdown
Contributor

@fennoai fennoai Bot left a comment

Choose a reason for hiding this comment

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

Documentation Review Summary

This is a well-structured and carefully written formal specification. The "Conformance" and "Excluded semantics" sections are clear, and the overall organization is logical. The terminology changes in classfile-spec.md are consistent and improve precision.

Below are noteworthy findings, mostly around terminology consistency and completeness within the specification.

Key themes:

  • A few undefined or inconsistently-used terms that could cause ambiguity in a formal specification
  • One example references an undeclared type
  • The StandardDQLQuery production lacks a cross-reference to a normative DQL definition
  • Minor specification-level design considerations for future implementors around resource name validation

Comment thread doc/classfile-resource-spec.md Outdated
Comment thread doc/classfile-resource-spec.md
Comment thread doc/classfile-resource-spec.md
Comment thread doc/classfile-resource-spec.md Outdated
Comment thread doc/classfile-resource-spec.md
Comment thread doc/classfile-resource-spec.md Outdated
Comment thread doc/classfile-spec.md Outdated
@aofei aofei force-pushed the classfile-resource-spec branch 9 times, most recently from 9afe576 to 212fcba Compare April 14, 2026 11:30
Add `doc/classfile-resource-spec.md` to define the resource model for
XGo classfile frameworks.

The specification now defines discovery-based resource introduction over
project-scoped pack documents, work classfile-implied top-level
resources, and static tool semantics for typed resource references.

This also updates `doc/classfile-spec.md` to define `pack` directives,
pack roots, and pack documents as the standardized discovery substrate
for classfile resource semantics.

Fixes goplus#2704
Updates goplus#2719

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@aofei aofei force-pushed the classfile-resource-spec branch from 212fcba to f067091 Compare April 15, 2026 00:57
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.

proposal: standardize classfile resource semantics

2 participants