2.5 KiB
2.5 KiB
| id | ticket | title | status | created | ref_decisions | tags | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PLN-0096 | pbs-symbol-documentation-and-hover-markdown | Validate Doc attribute semantics and diagnostics | open | 2026-07-15 |
|
|
Briefing
Enforce the semantic contract of [Doc] after syntax can represent it.
Objective
Reject invalid Doc usage and produce clear diagnostics for all invalid shapes and targets required by DEC-0039.
Dependencies
- Depends on
PLN-0092. - Depends on
PLN-0094. - Depends on
PLN-0095.
Scope
- Reserve
Docas a compiler-recognized attribute. - Accept only
Doc(markdown = """..."""). - Reject aliases, positional arguments, extra arguments, duplicate
Doc, empty normalized payload, parameter targets, and non-documentable targets. - Keep duplicates as semantic errors rather than parse errors.
Non-Goals
- Attach documentation to final symbol metadata.
- Expose documentation through LSP.
- Author stdlib documentation.
Execution Method
- Locate existing declaration and reserved attribute validators, including
PbsDeclarationSemanticsValidator,PbsDeclarationRuleValidator, and interface-module reserved attribute checks. - Add
Docvalidation in the semantic phase that already validates declaration attributes. - Define allowed declaration categories according to the spec: named API declarations that can carry attributes.
- Add or extend
PbsSemanticsErrorsdiagnostics for invalidDoctarget, invalid shape, duplicate attribute, missingmarkdown, extra arguments, and empty payload. - Add tests covering valid declaration targets and every invalid case.
Acceptance Criteria
- Every invalid shape named by
DEC-0039produces a semantic diagnostic. - Parameters never accept
[Doc]. - Duplicate
[Doc]on one declaration is rejected semantically. - Existing reserved attributes keep their current behavior.
Tests
PbsSemanticsDeclarationsTestPbsInterfaceModuleSemanticsTestPbsDiagnosticsContractTest
Affected Artifacts
prometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/semantics/PbsDeclarationSemanticsValidator.javaprometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/semantics/PbsDeclarationRuleValidator.javaprometeu-compiler/frontends/prometeu-frontend-pbs/src/main/java/p/studio/compiler/pbs/semantics/PbsSemanticsErrors.java- PBS semantics tests