@cassiomc1/forgeloop 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/copilot-instructions.md +1 -1
- package/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/CONTRIBUTING.md +90 -0
- package/DOCS_INDEX.md +13 -11
- package/ENG/c-development-eng.md +112 -0
- package/ENG/cpp-development-eng.md +109 -0
- package/ENG/dotnet-aspnetcore-development-eng.md +401 -0
- package/ENG/go-development-eng.md +103 -0
- package/ENG/java-development-eng.md +125 -0
- package/ENG/nodejs-backend-development-eng.md +605 -0
- package/ENG/php-development-eng.md +104 -0
- package/ENG/rust-development-eng.md +422 -0
- package/ENG/sql-development-eng.md +108 -0
- package/ENG/swift-development-eng.md +111 -0
- package/ENG/typescript-development-eng.md +108 -0
- package/GUIDE_ROUTER.md +418 -9
- package/QUALITY_SCORECARD.md +1 -0
- package/README.md +44 -33
- package/THIRD_PARTY_NOTICES.md +19 -7
- package/completions/_forgeloop +3 -3
- package/completions/forgeloop.bash +3 -3
- package/completions/forgeloop.fish +7 -0
- package/docs/AGENT_PROTOCOL_SUMMARY.md +55 -2
- package/docs/CLI_REFERENCE.md +28 -6
- package/docs/DOCUMENTATION_GUIDE.md +2 -1
- package/docs/GETTING_STARTED.md +59 -0
- package/docs/PACKAGE_CONTENTS.md +28 -14
- package/docs/RECIPES.md +23 -0
- package/docs/RELEASE_CHECKLIST.md +30 -2
- package/docs/TROUBLESHOOTING.md +100 -2
- package/docs/documentation-manifest.json +652 -0
- package/docs/protocol-requirements.json +77 -0
- package/package.json +19 -4
- package/schemas/routing-input.schema.json +1 -1
- package/scripts/CI_VALIDATORS.md +84 -11
- package/scripts/generate-agent-protocol-summary.mjs +36 -0
- package/src/commands/next.js +19 -7
- package/src/commands/task-create.js +84 -25
- package/src/commands/task-list.js +22 -2
- package/src/config/guides.json +44 -0
- package/src/core/build-script.js +151 -0
- package/src/core/c-cpp-project.js +143 -0
- package/src/core/cli-command-definitions.js +8 -1
- package/src/core/command-executors.js +5 -3
- package/src/core/command-input.js +140 -102
- package/src/core/contract-presets.js +82 -0
- package/src/core/error-codes.js +3 -3
- package/src/core/filesystem.js +1 -10
- package/src/core/go-project.js +206 -0
- package/src/core/java-project.js +403 -0
- package/src/core/multi-language-project.js +117 -0
- package/src/core/next-explanation.js +63 -0
- package/src/core/php-project.js +85 -0
- package/src/core/project-detection.js +1760 -52
- package/src/core/reconcile-closure.js +4 -1
- package/src/core/router.js +156 -3
- package/src/core/rust-project.js +400 -0
- package/src/core/sql-project.js +141 -0
- package/src/core/swift-project.js +200 -0
- package/src/core/typescript-project.js +349 -0
- package/src/core/xml-structure.js +123 -0
|
@@ -13,7 +13,7 @@ Use these instructions across the repository while preserving local rules.
|
|
|
13
13
|
- Select context with [`GUIDE_ROUTER.md`](../GUIDE_ROUTER.md) and report activated guide IDs.
|
|
14
14
|
- For repository-wide textual discovery, prefer `forgeloop search` and treat its results as discovery only; do not use them as verification evidence or scope authority.
|
|
15
15
|
- Respect the latest request, scope, and higher-level instructions.
|
|
16
|
-
- Make the smallest coherent change; validate with
|
|
16
|
+
- Make the smallest coherent change; use `npm run verify:fast` while editing and `npm run verify:prepush` before a PR, then validate with proportional regression checks.
|
|
17
17
|
- Diagnose causes before fixing failures; do not make unverified attempts.
|
|
18
18
|
- Do not install software, publish, delete, or alter external state without authority. Do not install a missing verification tool merely to satisfy a check. For missing Qwen-MM-Plugins, follow `LOOP_ENGINEERING.md`.
|
|
19
19
|
- Before creating or activating new lifecycle state: discover existing tasks first with `forgeloop task-list --json`; if an existing task is selected or identifiable, use `forgeloop next --task <id> --json` before creating another task, reconcile continuity when present, and inspect the checkout. A change of harness, model, provider, IDE, process, terminal, or session does not create a new task. Legacy singleton state such as `.forgeloop/work-state.json` is compatibility-only, not the primary modern discovery mechanism.
|
package/AGENTS.md
CHANGED
|
@@ -11,7 +11,7 @@ Do not treat ForgeLoop as vendor-specific, optional, or to follow only "in spiri
|
|
|
11
11
|
1. Inspect [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md). Confirm facts from sources; initialize if in `template` mode.
|
|
12
12
|
1. Use [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) to select relevant guides and report activated guide IDs.
|
|
13
13
|
1. For repository-wide textual discovery, prefer `forgeloop search` and treat its results as discovery only; do not use them as verification evidence or scope authority.
|
|
14
|
-
1. Make the smallest coherent change
|
|
14
|
+
1. Make the smallest coherent change; use `npm run verify:fast` while editing and `npm run verify:prepush` before a PR, then run proportional regression checks.
|
|
15
15
|
1. Diagnose failures before fixing; do not repeat attempts without new evidence.
|
|
16
16
|
1. Do not install software, publish, delete, or migrate data without authority. Do not install a missing verification tool merely to satisfy a check. For missing Qwen-MM-Plugins, follow `LOOP_ENGINEERING.md`.
|
|
17
17
|
1. Before creating or activating new lifecycle state: discover existing tasks first with `forgeloop task-list --json`; if an existing task is selected or identifiable, use `forgeloop next --task <id> --json` before creating another task, reconcile continuity when present, and inspect the checkout. A change of harness, model, provider, IDE, process, terminal, or session does not create a new task. Legacy singleton state such as `.forgeloop/work-state.json` is compatibility-only, not the primary modern discovery mechanism.
|
package/CLAUDE.md
CHANGED
|
@@ -13,7 +13,7 @@ When working in this repository:
|
|
|
13
13
|
1. Verify [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md) against real sources; initialize if in `template` mode.
|
|
14
14
|
1. Consult [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md), select relevant guides, and announce their IDs.
|
|
15
15
|
1. For repository-wide textual discovery, prefer `forgeloop search` and treat its results as discovery only; do not use them as verification evidence or scope authority.
|
|
16
|
-
1. Make small changes
|
|
16
|
+
1. Make small changes; use `npm run verify:fast` while editing and `npm run verify:prepush` before a PR, then run proportional regression checks.
|
|
17
17
|
1. Investigate root causes before fixing failures; do not make unverified attempts.
|
|
18
18
|
1. Request authority for unrelated installations, publications, deletions, or migrations. Do not install a missing verification tool merely to satisfy a check. For missing Qwen-MM-Plugins, follow `LOOP_ENGINEERING.md`.
|
|
19
19
|
1. Before creating or activating new lifecycle state: discover existing tasks first with `forgeloop task-list --json`; if an existing task is selected or identifiable, use `forgeloop next --task <id> --json` before creating another task, reconcile continuity when present, and inspect the checkout. A change of harness, model, provider, IDE, process, terminal, or session does not create a new task. Legacy singleton state such as `.forgeloop/work-state.json` is compatibility-only, not the primary modern discovery mechanism.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Contributing to ForgeLoop
|
|
2
|
+
|
|
3
|
+
## Before opening a pull request
|
|
4
|
+
|
|
5
|
+
Run `npm run verify:prepush` before opening a pull request. For fast feedback,
|
|
6
|
+
use `npm run test:quick` or `npm run verify:fast`; the full suite and coverage
|
|
7
|
+
gate are run once by the local pre-push tier and by one sharded PR-core lane.
|
|
8
|
+
The default `npm test` command is the complete no-coverage suite. `npm run test:ci`
|
|
9
|
+
uses the same discovered test files with two Node test workers for two-core CI
|
|
10
|
+
runners; PR Node 24 divides that same set into four deterministic shards and
|
|
11
|
+
aggregates coverage without rerunning tests. `npm run test:watch` provides
|
|
12
|
+
local watch mode. Run `npm run mcp:setup` explicitly when MCP checks are in
|
|
13
|
+
scope. Keep CLI metadata, generated
|
|
14
|
+
references, schemas, completions, summaries, and conformance scenarios
|
|
15
|
+
aligned. Do not add vendor-specific runtime behavior: ForgeLoop remains a
|
|
16
|
+
file-backed protocol and support CLI.
|
|
17
|
+
|
|
18
|
+
The ordinary PR workflow is intentionally path-aware. `pr-core.yml` always
|
|
19
|
+
publishes the ruleset contexts `audit`, `CodeQL`, `Verify generated Archify
|
|
20
|
+
diagram`, `validate (22)`, `tarball smoke (ubuntu-latest)`, and
|
|
21
|
+
`dependency-review`; `validate (22)` fails closed if an applicable job fails
|
|
22
|
+
or is skipped unexpectedly. Broader main-branch and release workflows provide
|
|
23
|
+
the explicit cross-platform, package, Windows, documentation, and audit
|
|
24
|
+
coverage that is not duplicated on every pull request.
|
|
25
|
+
|
|
26
|
+
## Protocol changes
|
|
27
|
+
|
|
28
|
+
Any persisted artifact or lifecycle change must preserve the published schema
|
|
29
|
+
compatibility policy, add valid and invalid fixtures, update `protocol-info`,
|
|
30
|
+
and include a recovery path for interrupted writes. A breaking protocol change
|
|
31
|
+
requires a new explicit protocol version and migration plan.
|
|
32
|
+
|
|
33
|
+
## Documentation & MCP verification
|
|
34
|
+
|
|
35
|
+
- Follow [`docs/DOCUMENTATION_GUIDE.md`](./docs/DOCUMENTATION_GUIDE.md); run
|
|
36
|
+
`npm run docs:generate`, `npm run completions:generate`, and
|
|
37
|
+
`npm run summary:generate` before `npm run docs:check` when canonical
|
|
38
|
+
registries change.
|
|
39
|
+
- Changes under `integrations/mcp/` require `npm run mcp:test`, and package
|
|
40
|
+
changes require `npm run mcp:pack:check`.
|
|
41
|
+
- `npm run mcp:test` never installs dependencies. If the MCP package is not
|
|
42
|
+
set up, run `npm run mcp:setup` explicitly when installation is authorized.
|
|
43
|
+
|
|
44
|
+
## Frozen repository validators
|
|
45
|
+
|
|
46
|
+
The supported local Python command is `python3 -m unittest discover -s tests`.
|
|
47
|
+
The frozen validators require Python 3.9 or newer and are compatibility tools
|
|
48
|
+
used by CI; they are not a replacement for the Node test suite.
|
|
49
|
+
|
|
50
|
+
## Release and performance checks
|
|
51
|
+
|
|
52
|
+
Use `npm run coverage` followed by `npm run critical-coverage:check` for
|
|
53
|
+
coverage gates; coverage is intentionally not part of the default test command
|
|
54
|
+
or the PR unit-test job. `npm run performance:check` measures the median
|
|
55
|
+
startup time of the read-only `protocol-info` command using a broad
|
|
56
|
+
shared-runner budget.
|
|
57
|
+
Historical link exclusions in `.lychee.toml` are reviewed manually at least
|
|
58
|
+
quarterly and must not be removed automatically.
|
|
59
|
+
|
|
60
|
+
On native Windows, local antivirus scanning can dominate repeated Node process
|
|
61
|
+
startup. If permitted by local security policy, ask IT to exclude the trusted
|
|
62
|
+
`node.exe` executable, this repository root, and its `node_modules` directory
|
|
63
|
+
from Windows Defender real-time scanning. Do not disable protection globally or
|
|
64
|
+
apply exclusions to untrusted directories. If native Windows remains slow,
|
|
65
|
+
WSL2 is a supported alternative for local development; retain native Windows
|
|
66
|
+
CI for Windows-specific path and process behavior.
|
|
67
|
+
|
|
68
|
+
## Review expectations
|
|
69
|
+
|
|
70
|
+
PRs must explain the task contract, verification evidence, migration impact,
|
|
71
|
+
and compatibility impact. Never commit secrets, external credentials, or
|
|
72
|
+
unverified publication claims.
|
|
73
|
+
|
|
74
|
+
## Focused verification and maintenance
|
|
75
|
+
|
|
76
|
+
`npm test -- tests/transaction.test.js` runs a selected file. Directories select
|
|
77
|
+
all nested test files; helpers and fixtures are excluded. Name filters such as
|
|
78
|
+
`npm test -- --test-name-pattern='transaction' tests/transaction.test.js` are
|
|
79
|
+
forwarded to Node. Unsupported options and unmatched selectors fail explicitly.
|
|
80
|
+
|
|
81
|
+
Run `npm run complexity:check` with lint. Reductions are welcome; increases to
|
|
82
|
+
the committed hotspot budget require an explicit explanation and review.
|
|
83
|
+
TypeScript and YAML are development-only dependencies for packed-consumer and
|
|
84
|
+
semantic workflow verification; the core runtime has no npm dependencies.
|
|
85
|
+
|
|
86
|
+
Transaction payload maintenance is opt-in:
|
|
87
|
+
`npm run transactions:compact -- --path /path/to/project --retain-days 7`
|
|
88
|
+
previews the operation; add `--apply` to compact eligible payloads. Manifests,
|
|
89
|
+
ledgers, recent transactions, and ambiguous outcomes remain intact. See the
|
|
90
|
+
[Astra implementation record](docs/ASTRA_IMPLEMENTATION.md) for boundaries.
|
package/DOCS_INDEX.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Documentation index
|
|
2
2
|
|
|
3
|
-
The machine-readable inventory is
|
|
3
|
+
The repository's machine-readable documentation inventory is
|
|
4
4
|
[`docs/documentation-manifest.json`](./docs/documentation-manifest.json). It
|
|
5
|
-
classifies
|
|
6
|
-
records generated/deprecated-document metadata.
|
|
7
|
-
|
|
5
|
+
classifies maintained documentation, names canonical concept owners, and
|
|
6
|
+
records generated/deprecated-document metadata. The package file list and
|
|
7
|
+
guide registry additionally define the shipped consumer surface. Normative
|
|
8
|
+
requirements and their implementation/test mappings are in
|
|
8
9
|
[`docs/protocol-requirements.json`](./docs/protocol-requirements.json).
|
|
9
10
|
|
|
10
11
|
ForgeLoop keeps one canonical process and separates protocol behavior from
|
|
@@ -49,11 +50,11 @@ integration and guide context. Use this map before editing documentation.
|
|
|
49
50
|
| Capability levels, discovery, and degradation | [`PROTOCOL_INTEGRATION.md`](./PROTOCOL_INTEGRATION.md) | Vendor-neutral harness contract |
|
|
50
51
|
| Host/orchestrator integration | [`ORCHESTRATOR_INTEGRATION.md`](./ORCHESTRATOR_INTEGRATION.md) | Serializable phases, transition boundaries, host responsibilities, and no-runtime integration contract |
|
|
51
52
|
| Durable project facts | [`PROJECT_PROFILE.md`](./PROJECT_PROFILE.md) | Target-specific facts only; no prompts or secrets |
|
|
52
|
-
| Guide selection | [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) | Deterministic routing and exclusions |
|
|
53
|
+
| Guide selection | [`GUIDE_ROUTER.md`](./GUIDE_ROUTER.md) | Deterministic routing, project evidence, overlays, bounds, and exclusions |
|
|
53
54
|
| Architecture and safety boundaries | [`LOOP_SYSTEM_DESIGN.md`](./LOOP_SYSTEM_DESIGN.md) and [`THREAT_MODEL.md`](./THREAT_MODEL.md) | Design rationale and residual risk |
|
|
54
55
|
| Artifact and phase schemas | [`schemas/`](./schemas/) and [`CONTRACT_COVERAGE.md`](./CONTRACT_COVERAGE.md) | Versioned machine-readable contract |
|
|
55
56
|
| CLI/package behavior | [`src/`](./src/) and [`tests/`](./tests/) | Executable implementation and regression evidence |
|
|
56
|
-
| Guide content | [`ENG/`](./ENG/) | Context-specific, English-only operational guides, including
|
|
57
|
+
| Guide content | [`ENG/`](./ENG/) | Context-specific, English-only operational guides, including Flutter, .NET, Node.js, Rust, C, C++, Java, SQL, Go, TypeScript, PHP, and Swift specialists; ASP.NET Core and ABP remain .NET overlays |
|
|
57
58
|
| Diagram governance | [`docs/diagrams/manifest.json`](./docs/diagrams/manifest.json) | Authoritative taxonomy, renderer mapping, canonical purposes, artifact ownership, and references |
|
|
58
59
|
| Diagram maintainer entrypoint | [`docs/diagrams/README.md`](./docs/diagrams/README.md) | Typed Archify source, animated HTML explorer, animated SVG fallback, review, and regeneration workflow |
|
|
59
60
|
| Engineering flow diagram | [`docs/assets/diagrams/forgeloop-engineering-flow.html`](./docs/assets/diagrams/forgeloop-engineering-flow.html) | Conceptual lifecycle from request through validator-backed completion |
|
|
@@ -151,11 +152,12 @@ loop, and secret-scanning contracts that have not been migrated to Node. Their
|
|
|
151
152
|
scope, exact commands, and migration boundary are recorded in
|
|
152
153
|
[`scripts/CI_VALIDATORS.md`](./scripts/CI_VALIDATORS.md).
|
|
153
154
|
|
|
154
|
-
The package
|
|
155
|
-
|
|
156
|
-
`npm run dependency:policy`. GitHub
|
|
157
|
-
CodeQL, dependency review, and
|
|
158
|
-
|
|
155
|
+
The package uses the approved exact `smol-toml` runtime dependency for bounded
|
|
156
|
+
Cargo manifest parsing. Development dependencies remain limited to c8, ESLint,
|
|
157
|
+
TypeScript, and YAML and are checked by `npm run dependency:policy`. GitHub
|
|
158
|
+
Actions use `npm ci`, pinned action SHAs, CodeQL, dependency review, and
|
|
159
|
+
generated-release notes; npm publication still uses trusted OIDC publishing
|
|
160
|
+
and is not implied by local verification.
|
|
159
161
|
|
|
160
162
|
## Editing rules
|
|
161
163
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: c-development-eng
|
|
3
|
+
language: en
|
|
4
|
+
description: "Specialist guidance for production C libraries, services, embedded components, and native build systems."
|
|
5
|
+
version: "2026.09"
|
|
6
|
+
last-reviewed: "2026-09-12"
|
|
7
|
+
guide-id: c
|
|
8
|
+
requires-gates:
|
|
9
|
+
- threat-boundary
|
|
10
|
+
completion-evidence:
|
|
11
|
+
- c-validation
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# C Development Engineering Guide
|
|
15
|
+
|
|
16
|
+
## Mission and activation
|
|
17
|
+
|
|
18
|
+
Use this guide for C libraries, services, workers, embedded components, and
|
|
19
|
+
native integrations. ForgeLoop confirms C from an explicit CMake or Meson C
|
|
20
|
+
declaration, a native Bazel rule with owned implementation source, or a direct
|
|
21
|
+
claim to an owned `.c` file. `.h`/`.inc` files, a Makefile alone, compiler
|
|
22
|
+
flags, a Docker image, a package name, generated output, and vendored code are
|
|
23
|
+
not C project identity. C and C++ may be confirmed at the same root.
|
|
24
|
+
|
|
25
|
+
Detection is local, deterministic, bounded, and read-only. It does not invoke
|
|
26
|
+
CMake, Meson, Make, Bazel, a compiler, a linker, a generator, or project code.
|
|
27
|
+
|
|
28
|
+
## Authority and precedence
|
|
29
|
+
|
|
30
|
+
Repository architecture, supported platforms, compiler configuration, ABI,
|
|
31
|
+
warning policy, and minimum supported toolchain win over generic advice. Use
|
|
32
|
+
the matching repository standard and toolchain first, then the ISO/WG14
|
|
33
|
+
material and version-matched platform documentation. C23 (ISO/IEC 9899:2024)
|
|
34
|
+
is the current published reference in the 2026-09 plan snapshot; C2y remains
|
|
35
|
+
development work and is not an automatic migration target.
|
|
36
|
+
|
|
37
|
+
## Project and standard discovery
|
|
38
|
+
|
|
39
|
+
Read bounded build metadata and claimed/owned implementation files. Treat
|
|
40
|
+
`project(app LANGUAGES C)`, `project(app C)`, `enable_language(C)`, and
|
|
41
|
+
`project('app', 'c')` as explicit language evidence; CMake command names are
|
|
42
|
+
case-insensitive. CMake's omitted language defaults are ambiguous to a static
|
|
43
|
+
detector, so `project(app)` needs owned implementation source before it
|
|
44
|
+
establishes C. A `cc_*` Bazel rule needs owned `.c` source because the rule may
|
|
45
|
+
also build C++. A Makefile becomes meaningful
|
|
46
|
+
only with owned implementation source.
|
|
47
|
+
|
|
48
|
+
Keep the language standard, compiler mode (`-std=c23` versus `-std=gnu23`),
|
|
49
|
+
library/ABI, target triple, libc, warning policy, sanitizer configuration, and
|
|
50
|
+
runtime platform as separate decisions. A compiler's default is not a license
|
|
51
|
+
to migrate the repository.
|
|
52
|
+
|
|
53
|
+
## Architecture and semantics
|
|
54
|
+
|
|
55
|
+
Make ownership, lifetime, storage duration, pointer validity, allocation and
|
|
56
|
+
cleanup contracts explicit. Review array bounds, NUL termination, integer
|
|
57
|
+
conversion, signed/unsigned behavior, overflow, alignment, provenance, strict
|
|
58
|
+
aliasing, format strings, initialization, double-free, use-after-free, and
|
|
59
|
+
partial-failure paths. Do not silence a warning with a cast unless the
|
|
60
|
+
conversion is proven at the boundary.
|
|
61
|
+
|
|
62
|
+
Keep transport, parsing, domain, persistence, platform, and FFI adapters
|
|
63
|
+
separate where the repository does. Define an error convention that preserves
|
|
64
|
+
the cause without leaking secrets, and make cleanup work on every return path.
|
|
65
|
+
|
|
66
|
+
## I/O, concurrency, and security
|
|
67
|
+
|
|
68
|
+
Bound file, socket, parser, decompression, allocation, and message sizes.
|
|
69
|
+
Validate lengths before arithmetic and validate encodings and protocol state
|
|
70
|
+
before use. Treat environment values, files, IPC, network input, format
|
|
71
|
+
strings, and FFI data as hostile. Make timeouts, cancellation, signal handling,
|
|
72
|
+
thread ownership, locking, atomics, and shutdown behavior explicit; never
|
|
73
|
+
create unbounded work or share mutable state without a documented invariant.
|
|
74
|
+
|
|
75
|
+
## Performance and portability
|
|
76
|
+
|
|
77
|
+
Measure before optimizing. Preserve cache, allocation, syscall, and startup
|
|
78
|
+
budgets with benchmarks or profiling evidence. Keep platform adapters narrow;
|
|
79
|
+
document endianness, alignment, filesystem, clock, thread, and socket
|
|
80
|
+
assumptions. Sanitizers, fuzzers, static analysis, and cross-compilation
|
|
81
|
+
results are verification evidence, not project-detection evidence.
|
|
82
|
+
|
|
83
|
+
## Build, dependency, and interop policy
|
|
84
|
+
|
|
85
|
+
Keep compiler, linker, C library, SDK, feature, and generated-code versions
|
|
86
|
+
reproducible. Review third-party code and license/ABI consequences without
|
|
87
|
+
executing package-manager hooks during routing. For C++ or foreign-function
|
|
88
|
+
boundaries, specify ownership, layout, calling convention, error translation,
|
|
89
|
+
threading, and lifetime rules. Generated and vendored trees remain dependency
|
|
90
|
+
boundaries.
|
|
91
|
+
|
|
92
|
+
## Verification and Definition of Done
|
|
93
|
+
|
|
94
|
+
Run the narrowest compiler, warning, sanitizer, static-analysis, unit,
|
|
95
|
+
integration, fuzz, and cross-platform checks that prove the changed behavior,
|
|
96
|
+
then the repository checks. Record the exact source mode, target, compiler,
|
|
97
|
+
linker, sanitizer, and command. A missing tool is `NOT_VERIFIED`, not a pass.
|
|
98
|
+
|
|
99
|
+
Before completion, confirm ownership and cleanup paths, malformed/partial input
|
|
100
|
+
tests, resource and concurrency limits, security review, reproducibility, and
|
|
101
|
+
the exact artifact or binary contract. ForgeLoop performs bounded structural
|
|
102
|
+
native-project analysis, not preprocessing, compiler execution, ABI analysis,
|
|
103
|
+
or linker resolution.
|
|
104
|
+
|
|
105
|
+
## Official sources
|
|
106
|
+
|
|
107
|
+
- [ISO/IEC JTC 1/SC 22/WG14](https://www.open-std.org/jtc1/sc22/wg14/)
|
|
108
|
+
- [C23 project status](https://www.open-std.org/jtc1/sc22/wg14/www/projects)
|
|
109
|
+
- [GNU C Library manual](https://sourceware.org/glibc/manual/latest/html_node/)
|
|
110
|
+
- [CMake project languages](https://cmake.org/cmake/help/latest/command/project.html)
|
|
111
|
+
- [Meson language reference](https://mesonbuild.com/Reference-manual_functions.html#project)
|
|
112
|
+
- [Bazel C/C++ rules](https://bazel.build/reference/be/c-cpp)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cpp-development-eng
|
|
3
|
+
language: en
|
|
4
|
+
description: "Specialist guidance for production C++ libraries, services, tools, and native build systems."
|
|
5
|
+
version: "2026.09"
|
|
6
|
+
last-reviewed: "2026-09-12"
|
|
7
|
+
guide-id: cpp
|
|
8
|
+
requires-gates:
|
|
9
|
+
- threat-boundary
|
|
10
|
+
completion-evidence:
|
|
11
|
+
- cpp-validation
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# C++ Development Engineering Guide
|
|
15
|
+
|
|
16
|
+
## Mission and activation
|
|
17
|
+
|
|
18
|
+
Use this guide for production C++ libraries, services, workers, tools, and
|
|
19
|
+
native integrations. ForgeLoop confirms C++ from explicit CMake/Meson CXX or
|
|
20
|
+
cpp declarations, a native Bazel rule with owned `.cc`, `.cpp`, `.cxx`, `.c++`,
|
|
21
|
+
or `.C` source, or a direct claim to owned implementation source. Header-only
|
|
22
|
+
files, a Makefile alone, compiler versions, flags, package metadata, generated
|
|
23
|
+
output, and vendored code are insufficient without compatible project context.
|
|
24
|
+
C and C++ may be confirmed at one root.
|
|
25
|
+
|
|
26
|
+
Detection is bounded and static. It never executes a compiler, build generator,
|
|
27
|
+
package manager, test binary, macro, or code-generation step.
|
|
28
|
+
|
|
29
|
+
## Authority and precedence
|
|
30
|
+
|
|
31
|
+
Repository architecture, standard mode, ABI, supported compilers, target
|
|
32
|
+
platforms, and public compatibility policy win over generic best practice.
|
|
33
|
+
Use WG21, the actual compiler documentation, and version-matched platform
|
|
34
|
+
documentation after repository evidence. C++23 (ISO/IEC 14882:2024) is the
|
|
35
|
+
published reference in the 2026-09 plan snapshot. C++26 compiler support is
|
|
36
|
+
not permission to migrate a C++17/20/23 repository.
|
|
37
|
+
|
|
38
|
+
## Project and standard discovery
|
|
39
|
+
|
|
40
|
+
Treat `project(app LANGUAGES CXX)`, `enable_language(CXX)`, Meson's `cpp`
|
|
41
|
+
language, and an owned-source-backed `cc_*` Bazel rule as structural evidence.
|
|
42
|
+
CMake's default `project(app)` is ambiguous and requires owned implementation
|
|
43
|
+
source before it confirms C or C++. A `.C` extension is the conventional
|
|
44
|
+
case-sensitive C++ source form; `.h` remains ambiguous while `.hpp`, `.hh`,
|
|
45
|
+
`.hxx`, and `.inl` are contextual headers.
|
|
46
|
+
|
|
47
|
+
Keep language standard, compiler mode, standard library, ABI, target triple,
|
|
48
|
+
runtime, visibility, exception/RTTI policy, and vendor toolset separate. Do
|
|
49
|
+
not infer the repository standard from a host compiler's newest mode.
|
|
50
|
+
|
|
51
|
+
## Architecture and semantics
|
|
52
|
+
|
|
53
|
+
Make ownership and lifetime visible. Prefer RAII, value semantics, the rule of
|
|
54
|
+
zero, narrow interfaces, and explicit move/copy contracts. Review references,
|
|
55
|
+
temporary lifetime, dangling pointers, object slicing, virtual dispatch,
|
|
56
|
+
destruction, allocator behavior, iterator invalidation, alignment, strict
|
|
57
|
+
aliasing, undefined behavior, ODR/linkage, templates, concepts, ranges,
|
|
58
|
+
coroutines, modules, and C interoperability.
|
|
59
|
+
|
|
60
|
+
Do not mechanically replace every raw pointer with `shared_ptr`: raw pointers
|
|
61
|
+
can correctly express non-owning references, C APIs, intrusive structures, or
|
|
62
|
+
mapped memory. For public libraries, review symbols, layout, vtables,
|
|
63
|
+
standard-library ABI, exception ABI, visibility, and compiler/runtime
|
|
64
|
+
compatibility before changing types.
|
|
65
|
+
|
|
66
|
+
## Errors, concurrency, I/O, and security
|
|
67
|
+
|
|
68
|
+
Choose exceptions or error-return types deliberately and preserve causes.
|
|
69
|
+
Specify `noexcept` and cancellation behavior at boundaries. Make thread
|
|
70
|
+
ownership, atomics, memory ordering, locks, condition variables, queues,
|
|
71
|
+
coroutine cancellation, and shutdown bounded and observable. Protect parsers,
|
|
72
|
+
serialization, filesystem, IPC, network, environment, and FFI boundaries with
|
|
73
|
+
length, encoding, authorization, timeout, and resource checks.
|
|
74
|
+
|
|
75
|
+
## Performance and portability
|
|
76
|
+
|
|
77
|
+
Measure allocation, cache, syscall, queue, startup, and latency changes with
|
|
78
|
+
benchmarks or profiles. Keep platform adapters and compile-time feature
|
|
79
|
+
selection explicit. Record endianness, alignment, filesystem, clock, locale,
|
|
80
|
+
thread, linker, and standard-library assumptions. Sanitizers, fuzzing, and
|
|
81
|
+
static analysis prove selected paths; they do not establish universal safety.
|
|
82
|
+
|
|
83
|
+
## Build, dependencies, and interop
|
|
84
|
+
|
|
85
|
+
Keep CMake/Meson/Bazel configuration, compiler/linker flags, generated code,
|
|
86
|
+
package versions, and ABI policy reproducible. Treat build files as executable
|
|
87
|
+
configuration and never run them during routing. At C, Objective-C, Rust,
|
|
88
|
+
Swift, or other FFI boundaries document layout, ownership transfer, error
|
|
89
|
+
translation, calling convention, thread rules, and lifetime.
|
|
90
|
+
|
|
91
|
+
## Verification and Definition of Done
|
|
92
|
+
|
|
93
|
+
Run focused compiler, warning, sanitizer, static-analysis, unit, integration,
|
|
94
|
+
fuzz, ABI, and cross-platform checks for the exact target and standard, then
|
|
95
|
+
the repository checks. Record compiler, standard library, linker, flags, and
|
|
96
|
+
platform. Missing tooling is `NOT_VERIFIED`. Completion requires tested error,
|
|
97
|
+
cleanup, concurrency, resource, and compatibility behavior plus reproducible
|
|
98
|
+
packaging. ForgeLoop performs bounded structural native-project analysis, not
|
|
99
|
+
template instantiation, preprocessing, ABI compatibility analysis, or build
|
|
100
|
+
execution.
|
|
101
|
+
|
|
102
|
+
## Official sources
|
|
103
|
+
|
|
104
|
+
- [WG21 committee documents](https://www.open-std.org/jtc1/sc22/wg21/)
|
|
105
|
+
- [GCC C++ dialect options](https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html)
|
|
106
|
+
- [Clang C++ language status](https://clang.llvm.org/cxx_status.html)
|
|
107
|
+
- [CMake project languages](https://cmake.org/cmake/help/latest/command/project.html)
|
|
108
|
+
- [Meson language reference](https://mesonbuild.com/Reference-manual_functions.html#project)
|
|
109
|
+
- [Bazel C/C++ rules](https://bazel.build/reference/be/c-cpp)
|