# Contributing

**Status: draft for review.** Contribution terms, in particular the
licensing section, have not been finalised.

Thank you for helping with OpenFlange. This repository holds the
specifications, schemas, RFCs and portable conformance fixtures. Runner
code lives elsewhere.

Note that the project is not yet published: there is no public GitHub
organisation or issue tracker at the time of writing. The flow below is
how contributions are intended to work once there is.

## What kind of change is it?

| Change | How |
|---|---|
| Typo, wording, clarification with no change in behaviour | Pull request. |
| New example, new conformance fixture for already-specified behaviour | Pull request. |
| Ambiguity or contradiction in a specification | Issue first, then a pull request or RFC depending on the fix. |
| New feature, changed behaviour, new error code, maturity change, deprecation | RFC first: see [rfcs/README.md](rfcs/README.md). |

Decisions are made as described in [GOVERNANCE.md](GOVERNANCE.md).

## Pull request flow

1. Branch from `main`.
2. Make one logical change per commit. Use
   [Conventional Commits](https://www.conventionalcommits.org/) subjects,
   for example `docs(pipeline): clarify broadcast ordering`,
   `fix(schemas): allow x- keys on ports`, `test(conformance): add
   sliding-window fixture`, `feat(http): ...` (with an RFC).
3. Run the validator and make it pass (see below).
4. Update [CHANGELOG.md](CHANGELOG.md) under "Unreleased" for anything a
   reader or implementer would notice.
5. Open the pull request. Say which specification(s) are affected and
   whether the change is normative.

Keep specification text, schemas, examples and fixtures consistent in the
same pull request. A normative change is not complete until all four agree.

## Run the validator

```sh
uv run tools/validate.py
```

Only [uv](https://docs.astral.sh/uv/) is required; the script declares its
own dependencies and installs nothing globally. Use `-v` to list every
check. The same command runs in CI
(`.github/workflows/validate.yml`).

## Writing specification text

- Use the RFC 2119 keywords MUST, MUST NOT, SHOULD, SHOULD NOT and MAY in
  capitals, and only for normative statements.
- Use the defined terms (pipe, source, sink, pipeline, subpipeline, node,
  port, stream, run, dataset). "Workflow" is reserved for future
  control-flow orchestration; do not use it for pipelines.
- Give every feature a maturity label (`proposed`, `experimental`,
  `stable`, `deprecated`).
- Keep the frontmatter of `specs/<name>/v0.1.md` intact (`title`, `spec`,
  `version`, `status`, `updated`, `summary`); the website renders from it.
- State what is deferred rather than leaving it unsaid.
- Do not describe anything as implemented, released or live unless it is.

## Examples must be tagged

Every machine-readable example in a specification, RFC or root document
must be a fenced code block whose info string is the language followed by
an `openflange:<kind>` marker, so that the validator checks it against the
corresponding schema. The marker goes after the language, separated by a
space: a block opened with three backticks and `yaml openflange:pipe`
contains pipe manifest frontmatter; `yaml openflange:pipeline` a pipeline
file; `json openflange:cli-config` a CLI execution configuration; and so
on.

- `<kind>` names a schema file: kind `pipe` is checked against
  `schemas/pipe-v0.1.schema.json`, kind `http-session-request` against
  `schemas/http-session-request-v0.1.schema.json`.
- `markdown openflange:manifest` marks a complete `OPENFLANGE.md` document;
  its frontmatter and its attribution link are both checked.
- With language `ndjson`, every line is checked separately.
- Add the word `invalid` after the marker for an example that is meant to
  be rejected; the validator then requires it to fail.

Blocks without a marker are not checked. Use them only for fragments that
cannot stand alone (grammar sketches, HTTP transcripts, shell sessions),
and prefer a complete, checkable example where possible. Do not put
placeholder values such as `<commit>` in tagged examples.

## Conformance fixtures

Fixtures are data, not code: see
[conformance/README.md](conformance/README.md) for the layout and the
`expect.yaml` format. Run fixtures may use only local Starlark pipes and
`std:` references, so that any conformant runner can execute them without
network access. Do not add fixtures that need paid services, secrets or
external hosts.

## Security

Do not include secrets, tokens or personal data in examples or fixtures.
Use obviously synthetic data and reserved domains such as `example.com`.
A private channel for reporting security issues has not been set up yet.

## Licensing of contributions (draft)

By contributing you agree that your contribution is licensed under the
same terms as the material it modifies (see [LICENSE](LICENSE)):

- specification text, RFCs and other documentation: **CC BY 4.0**;
- schemas, tools, code, code examples and conformance fixtures:
  **Apache-2.0**.

You must have the right to submit the contribution under those terms.

No contributor licence agreement (CLA) or Developer Certificate of Origin
(DCO) requirement has been decided. If one is adopted it will be announced
here before it is required, and it will not be applied retroactively
without the contributor's agreement.

Contributions do not grant, and are not granted, any trademark rights; see
[BRAND.md](BRAND.md) (draft).
