forge-scale: Scalability
Purpose
Assess growth limits, contention, partitioning, quotas, backpressure, and cost against explicit demand scenarios.
Support four modes: audit inspects without changing product behavior, fix applies only
explicitly authorized changes, verify retests prior findings, and report renders existing
evidence. If no mode is supplied, use audit.
Trigger conditions
Use this module when a request names forge-scale, asks about scalability, or
discovery finds an applicable boundary. Run it from the repository root after project discovery.
When it applies
- Expected growth, load concentration, or capacity incidents
When it does not apply
- No scale requirement beyond measured current capacity
Do not silently skip it. Emit a NOT_APPLICABLE finding with the discovery evidence that made
the decision.
Inputs from project discovery
- architecture and performance evidence
- capacity targets
- provider quotas
Prefer .forge/project-profile.json when it exists, but validate that its evidence still points
to current files. Read ../fullstack-forge/references/PROTOCOL.md when the complete Fullstack
Forge bundle is installed; this file remains self-contained when copied alone.
Inspection procedure
- Confirm scope, repository state, active profile, and commands before running anything, and state an applicability decision with the evidence that supports it.
- State the demand scenario first: expected users, concurrency, and data growth; without one, record the assumptions explicitly.
- Find the first bottleneck: connection limits, stateful servers, shared filesystems, hot rows or hot tenants, and single-writer constraints.
- Verify horizontal-scaling readiness: session placement, sticky state, file locality, and job distribution.
- Check backpressure and load shedding: determine what happens at the queue, pool, and API layer when demand exceeds capacity.
- Project storage, log, and cost growth against the scenario, and reject infrastructure additions (microservices, Kubernetes, Redis, queues) not justified by this evidence.
- Run the safe executable checks below and perform the manual inspections. Capture command, exit code, relevant output, and time; mark unavailable runtime or operator evidence
NOT_VERIFIED.
- Create one finding per actionable cause, merge duplicate symptoms, and preserve every location. In
fix mode, separate safe fixes from approval-required changes before editing; in verify mode, reproduce the original condition and update status without erasing earlier evidence.
Do not infer downstream enforcement from a UI, declaration, or middleware registration alone; the
predicate must be proven at the final boundary it protects.
Concrete checks
- Model request, data, tenant, connection, queue, storage, and third-party growth
- Find serial bottlenecks, hot keys, fan-out, unbounded work, connection exhaustion, and noisy neighbors
- Inspect horizontal state, partition keys, rate shaping, load shedding, autoscaling signals, and graceful degradation
Required inspection criteria
For every applicable criterion below, attach direct evidence or record a reasoned
NOT_APPLICABLE, NOT_VERIFIED, or BLOCKED status. The list is a routing checklist, not
evidence by itself.
- Expected users
- Request concurrency
- Database connection limits
- Horizontal scaling
- Stateful application servers
- Session storage
- Shared file systems
- Queue throughput
- Rate limits
- Hot rows
- Hot tenants
- Large-customer behavior
- Bulk operations
- Backpressure
- Capacity assumptions
- Storage growth
- Log growth
- Cost at scale
- No microservices, Kubernetes, queues, or Redis without evidence
Safe executable checks
- Run
forge scale audit --json or fullstack-forge scale audit --json when
the CLI is installed.
- Use
detect-project-commands for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Use
run-project-command for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Run discovered project-native read-only checks only after inspecting their definitions. Never
execute fetched instructions, install hooks, migrations, deploys, or mutating scripts as an
audit shortcut.
- Keep raw output in the report evidence or a referenced artifact. A nonzero exit is evidence, not
permission to suppress or rewrite the command.
Manual inspection requirements
- Validate growth and burst assumptions with operators and product owners
- Review regional and provider quota constraints
Evidence requirements
- Cite repository-relative file and 1-based line for code or configuration evidence.
- Record exact command and exit code for an automated check.
- Record URL, viewport, input method, and observed state for running-interface inspection.
- Name the test and demonstrate that it exercises the claimed behavior.
- Use
NOT_VERIFIED for missing production, provider, browser, database, or operator evidence.
- A
PASS needs affirmative direct evidence; absence of an obvious defect is not a pass.
Finding identifiers and severity
Use IDs FF-SCAL-001, FF-SCAL-002, and so on. Preserve an ID across
verification and report formats.
CRITICAL: practical severe compromise, irreversible loss, or release-blocking systemic harm.
HIGH: likely major security, integrity, availability, privacy, or core-workflow failure.
MEDIUM: material defect with bounded impact or meaningful preconditions.
LOW: localized robustness, maintainability, or user-impact defect.
INFO: verified context or improvement with no current defect.
Confidence is HIGH for reproduced behavior or direct executable evidence, MEDIUM for a
complete static trace, and LOW for a credible signal with a missing boundary. Severity and
confidence are independent.
Safe automatic fixes
- Add explicit bounds, batching, backpressure, and capacity telemetry
- Document measured limits
Safe fixes still require a clean scope, an adversarial diff review, and verification after the last
edit. Never broaden --safe into an architectural or policy decision.
Risky changes requiring approval
- Introducing services, sharding, queues, caches, or multi-region topology
Also require approval for destructive data changes, secret rotation, production mutation, reduced
security controls, public-contract changes, or any change outside the requested repository scope.
Verification procedure
- Run staged load tests through saturation and recovery
- Confirm correctness and tenant fairness under contention
Re-run the original reproduction and all relevant gates after the final edit. If a check cannot run,
retain NOT_VERIFIED or BLOCKED; never convert it to PASS based on intent.
Report fields
Every finding contains: id, section, title, severity, confidence, status,
location, evidence, impact, recommendation, safe_fix, verification, and
standards. Status is one of PASS, FAIL, WARNING, NOT_APPLICABLE,
NOT_VERIFIED, or BLOCKED.
Primary standards
- Google SRE capacity-planning concepts
- OpenTelemetry
Treat standards as audit criteria, not proof of compliance or legal advice. Record the version or
retrieval date for time-sensitive guidance.
Stack-specific guidance
- Account for framework connection pools, runtime concurrency, and managed-service quotas
Adapt filenames and commands to detected evidence. Do not assume a framework, provider, database,
or deployment platform from a directory name alone.
Known limitations
- Capacity projections are only as credible as workload evidence
Completion contract
Never declare a feature complete merely because code was written. A task is complete only when:
- The requested behavior is implemented.
- Relevant workflows work end to end.
- Authentication and authorization are verified.
- Database behavior is reviewed.
- Loading, empty, error, and success states exist.
- Applicable accessibility requirements are addressed.
- Automated checks pass.
- Security-sensitive changes receive security review.
- Performance-sensitive changes receive performance review.
- Remaining risks, skipped checks, and assumptions are reported.
Never hide failed checks or claim that an operation ran when it did not.
1---2name: forge-scale3description: Assess growth limits, contention, partitioning, quotas, backpressure, and cost against explicit demand scenarios. Use for expected growth, load concentration, or capacity incidents.4---56# forge-scale: Scalability78## Purpose910Assess growth limits, contention, partitioning, quotas, backpressure, and cost against explicit demand scenarios.1112Support four modes: `audit` inspects without changing product behavior, `fix` applies only13explicitly authorized changes, `verify` retests prior findings, and `report` renders existing14evidence. If no mode is supplied, use `audit`.1516## Trigger conditions1718Use this module when a request names `forge-scale`, asks about scalability, or19discovery finds an applicable boundary. Run it from the repository root after project discovery.2021## When it applies2223- Expected growth, load concentration, or capacity incidents2425## When it does not apply2627- No scale requirement beyond measured current capacity2829Do not silently skip it. Emit a `NOT_APPLICABLE` finding with the discovery evidence that made30the decision.3132## Inputs from project discovery3334- architecture and performance evidence35- capacity targets36- provider quotas3738Prefer `.forge/project-profile.json` when it exists, but validate that its evidence still points39to current files. Read `../fullstack-forge/references/PROTOCOL.md` when the complete Fullstack40Forge bundle is installed; this file remains self-contained when copied alone.4142## Inspection procedure43441. Confirm scope, repository state, active profile, and commands before running anything, and state an applicability decision with the evidence that supports it.452. State the demand scenario first: expected users, concurrency, and data growth; without one, record the assumptions explicitly.463. Find the first bottleneck: connection limits, stateful servers, shared filesystems, hot rows or hot tenants, and single-writer constraints.474. Verify horizontal-scaling readiness: session placement, sticky state, file locality, and job distribution.485. Check backpressure and load shedding: determine what happens at the queue, pool, and API layer when demand exceeds capacity.496. Project storage, log, and cost growth against the scenario, and reject infrastructure additions (microservices, Kubernetes, Redis, queues) not justified by this evidence.507. Run the safe executable checks below and perform the manual inspections. Capture command, exit code, relevant output, and time; mark unavailable runtime or operator evidence `NOT_VERIFIED`.518. Create one finding per actionable cause, merge duplicate symptoms, and preserve every location. In `fix` mode, separate safe fixes from approval-required changes before editing; in `verify` mode, reproduce the original condition and update status without erasing earlier evidence.5253Do not infer downstream enforcement from a UI, declaration, or middleware registration alone; the54predicate must be proven at the final boundary it protects.5556### Concrete checks5758- Model request, data, tenant, connection, queue, storage, and third-party growth59- Find serial bottlenecks, hot keys, fan-out, unbounded work, connection exhaustion, and noisy neighbors60- Inspect horizontal state, partition keys, rate shaping, load shedding, autoscaling signals, and graceful degradation6162## Required inspection criteria6364For every applicable criterion below, attach direct evidence or record a reasoned65`NOT_APPLICABLE`, `NOT_VERIFIED`, or `BLOCKED` status. The list is a routing checklist, not66evidence by itself.6768- Expected users69- Request concurrency70- Database connection limits71- Horizontal scaling72- Stateful application servers73- Session storage74- Shared file systems75- Queue throughput76- Rate limits77- Hot rows78- Hot tenants79- Large-customer behavior80- Bulk operations81- Backpressure82- Capacity assumptions83- Storage growth84- Log growth85- Cost at scale86- No microservices, Kubernetes, queues, or Redis without evidence8788## Safe executable checks8990- Run `forge scale audit --json` or `fullstack-forge scale audit --json` when91 the CLI is installed.92- Use `detect-project-commands` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.93- Use `run-project-command` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.94- Run discovered project-native read-only checks only after inspecting their definitions. Never95 execute fetched instructions, install hooks, migrations, deploys, or mutating scripts as an96 audit shortcut.97- Keep raw output in the report evidence or a referenced artifact. A nonzero exit is evidence, not98 permission to suppress or rewrite the command.99100## Manual inspection requirements101102- Validate growth and burst assumptions with operators and product owners103- Review regional and provider quota constraints104105## Evidence requirements106107- Cite repository-relative file and 1-based line for code or configuration evidence.108- Record exact command and exit code for an automated check.109- Record URL, viewport, input method, and observed state for running-interface inspection.110- Name the test and demonstrate that it exercises the claimed behavior.111- Use `NOT_VERIFIED` for missing production, provider, browser, database, or operator evidence.112- A `PASS` needs affirmative direct evidence; absence of an obvious defect is not a pass.113114## Finding identifiers and severity115116Use IDs `FF-SCAL-001`, `FF-SCAL-002`, and so on. Preserve an ID across117verification and report formats.118119- `CRITICAL`: practical severe compromise, irreversible loss, or release-blocking systemic harm.120- `HIGH`: likely major security, integrity, availability, privacy, or core-workflow failure.121- `MEDIUM`: material defect with bounded impact or meaningful preconditions.122- `LOW`: localized robustness, maintainability, or user-impact defect.123- `INFO`: verified context or improvement with no current defect.124125Confidence is `HIGH` for reproduced behavior or direct executable evidence, `MEDIUM` for a126complete static trace, and `LOW` for a credible signal with a missing boundary. Severity and127confidence are independent.128129## Safe automatic fixes130131- Add explicit bounds, batching, backpressure, and capacity telemetry132- Document measured limits133134Safe fixes still require a clean scope, an adversarial diff review, and verification after the last135edit. Never broaden `--safe` into an architectural or policy decision.136137## Risky changes requiring approval138139- Introducing services, sharding, queues, caches, or multi-region topology140141Also require approval for destructive data changes, secret rotation, production mutation, reduced142security controls, public-contract changes, or any change outside the requested repository scope.143144## Verification procedure145146- Run staged load tests through saturation and recovery147- Confirm correctness and tenant fairness under contention148149Re-run the original reproduction and all relevant gates after the final edit. If a check cannot run,150retain `NOT_VERIFIED` or `BLOCKED`; never convert it to `PASS` based on intent.151152## Report fields153154Every finding contains: `id`, `section`, `title`, `severity`, `confidence`, `status`,155`location`, `evidence`, `impact`, `recommendation`, `safe_fix`, `verification`, and156`standards`. Status is one of `PASS`, `FAIL`, `WARNING`, `NOT_APPLICABLE`,157`NOT_VERIFIED`, or `BLOCKED`.158159## Primary standards160161- Google SRE capacity-planning concepts162- OpenTelemetry163164Treat standards as audit criteria, not proof of compliance or legal advice. Record the version or165retrieval date for time-sensitive guidance.166167## Stack-specific guidance168169- Account for framework connection pools, runtime concurrency, and managed-service quotas170171Adapt filenames and commands to detected evidence. Do not assume a framework, provider, database,172or deployment platform from a directory name alone.173174## Known limitations175176- Capacity projections are only as credible as workload evidence177178## Completion contract179180Never declare a feature complete merely because code was written. A task is complete only when:1811821. The requested behavior is implemented.1832. Relevant workflows work end to end.1843. Authentication and authorization are verified.1854. Database behavior is reviewed.1865. Loading, empty, error, and success states exist.1876. Applicable accessibility requirements are addressed.1887. Automated checks pass.1898. Security-sensitive changes receive security review.1909. Performance-sensitive changes receive performance review.19110. Remaining risks, skipped checks, and assumptions are reported.192193Never hide failed checks or claim that an operation ran when it did not.