julia-script / julia-script/silk

Add function contract completion and synchronization actions

Open
#182 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
TypeScript
Stars
48
Forks
0
Avg merge
4h 49m
Merged PRs (30d)
213

Description

Summary

Add compiler-backed actions that complete or explicitly synchronize a function's full contract:

effect fn load() -> Data ! ParseError ? &FileSystem

This includes the result type, failure row, requirement row, and imports needed to spell those types.

Semantic product

Introduce a declaration-independent per-function summary such as:

FunctionDemand
  success/result type
  propagated failures
  propagated requirements
  effect/laziness facts
  provenance for every demanded member
  availability or underdetermination reason

It must derive facts from all reachable return/failure paths and remain available when the declared contract is missing or wrong—the state in which the action is needed.

Actions

  • Complete contract: conservatively add an absent result, failures, requirements, and required imports without narrowing an existing valid contract.
  • Minimize/synchronize contract: explicit refactor that may remove unused row members/imports or narrow a result after proving the implementation contract.
  • Return one atomic grouped change plan for header and import edits.
  • Reuse the scope-aware presentation and import planning introduced by #178.
  • Resolve actions against the originating revision.
  • Report recursive, generic, open-row, or otherwise underdetermined cases instead of guessing.

Lint behavior

Integrate with the warning framework from #181:

  • Missing required contract members may support actionable diagnostics.
  • Unnecessary failures/requirements may be linted where policy allows.
  • Public declarations must not be automatically narrowed merely because the current implementation is narrower; a wider public contract may be intentional.
  • Contract minimization for public functions must be opt-in or otherwise explicitly configured.

Acceptance criteria

  • Completion derives the result from all reachable returns, not only the final terminal.
  • Direct fail sites and rows demanded by run contribute structured canonical failures/requirements.
  • Missing imports for result/error/capability types are added or merged atomically.
  • Existing valid aliases and contract spelling are preserved unless the selected action explicitly synchronizes them.
  • Ambiguous or unavailable type presentation withholds the action or explains why it cannot be completed.
  • Recursive/generic/open-row tests cover determined and underdetermined cases.
  • Public/private contract minimization policy is specified and tested.
  • Stale action resolution never applies an old contract plan to new source.

Dependencies

  • Source-action and import-plan foundation: #178
  • Warning delivery for optional contract lints: #181

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the source-action and import-plan foundation in #178 and the warning framework in #181. Define how the FunctionDemand summary and contract actions satisfy the stated acceptance criteria, then add coverage for reachable paths, recursive/generic/open-row cases, public/private minimization, and stale action resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.