Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ respected.
- User-facing strings go through `gettext`.
- Run `mix format` before committing; `.formatter.exs` governs style.

## Documentation

Plans, specs, and architecture decision records live in `docs/`. The folder structure and
the rules are defined in `docs/README.md` — read it before adding or changing a document.

- **Plan to spec:** when a step of a plan is built, remove it from the plan and describe
the result in the spec.
- **Decisions:** a decision with a serious rejected alternative gets an ADR in `docs/adr/`.
- Working rules stay in this file; specs do not repeat them.

## Testing

- `mix test` auto-creates and migrates the test DB.
Expand Down
31 changes: 31 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Documentation

Each folder holds one kind of content with its own lifetime.
Folders are created on demand, when the first document needs them.

| Folder | Contains | Lifetime |
|--------------|---------------------------------------------------------------------------|-----------------------------------------------------|
| `plans/` | What we plan to build, in steps. Links to the ADRs it depends on. | Shrinks while the work is built. Deleted when done. |
| `specs/` | What is built and how it behaves. Enough to rebuild behavior and design. | Permanent. Updated with every change. |
| `adr/` | Architecture decision records: why we decided, and what we rejected. | Permanent. Not edited after acceptance. |
| `resources/` | Reference material, such as threat-modeling background and product facts. | Permanent. |
| `audit/` | Reviews and audit results. | Kept as a record. |

## Rules

- **Plan to spec.** When a step of a plan is built, remove it from the plan and
describe the result in the spec. Move only what is built. Each plan has a
status line at the top.
- **Decisions go into ADRs.** When a discussion ends in a decision with a serious
rejected alternative, write an ADR. Plans and specs link to ADRs and do not
repeat them.
- **Working rules stay in `AGENTS.md`.** Specs do not repeat them.
- **Backlog.** `plans/backlog.md` holds short entries for open work without a plan
of its own. When work on an entry starts and needs steps, it gets its own file
and is removed from the backlog.

## ADR conventions

- One decision per file, at most one screen long, named `NNNN-short-title.md`.
- An ADR is not edited after acceptance. A changed decision gets a new ADR, and
the old one is set to "Superseded by NNNN".
54 changes: 54 additions & 0 deletions docs/plans/backlog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Backlog

**Status:** open list. Last updated 2026-10-06.

Short entries for open work without a plan of its own. When work on an entry starts and
needs steps, it gets its own file in this folder and is removed from here.

## Upgrade Phoenix LiveView to 1.0

The app runs on LiveView 0.20 (`mix.exs`: `~> 0.20.12`). The upgrade to 1.0 changes
`mix.exs`, `mix.lock`, `assets/package.json`, and parts of
`lib/threat_shield_web/components/core_components.ex`.

## Run tests on all branches

`.github/workflows/test.yml` triggers on `branches: "*"`. This pattern does not match
branch names that contain a `/`, such as `chore/upgrade-elixir-postgres`. Pushes to these
branches start no test run. Use `"**"` or remove the branch filter.

## Build only after the tests

`.github/workflows/build.yml` starts on a push to `main`, on a pull request, and after the
"Run Tests" workflow. Only the last trigger checks the test result.

- A push to `main` builds the image twice: once directly, once after the tests.
- The direct build and the pull-request build do not wait for the tests.
- Every build pushes the `latest` image tag, including builds of pull requests that are
not merged.

## Login with OpenID Connect (Microsoft 365 / Entra ID)

Users log in with email and password only (`bcrypt_elixir`, `ThreatShieldWeb.UserAuth`).
Add login through an OpenID Connect provider. The first provider to support is
Microsoft Entra ID, so that users can log in with their Microsoft 365 account.

Open points: how an external identity maps to an existing user and to an organisation
membership, and whether an organisation can require this login for its members.

## REST API

The app has no API. The router defines an `:api` pipeline, but no route uses it. Add a
REST API for the domain objects (organisations, systems, assets, threats, risks,
mitigations).

Open points: authentication for API clients (for example API tokens), and how the
existing access control (`Scope`, `Members.Rights`) applies to API requests.

## Component hierarchy for systems

A system is a flat entry below an organisation. Allow a hierarchy, for example a system
that consists of sub-systems, which contain services.

Open points: the number of levels and their names, and how assets and threats relate to
a component and to its parent system.
Loading