nomoss 0.0.3 → 0.0.4

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.
Files changed (150) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +5 -15
  3. package/ROADMAP.md +2 -0
  4. package/docs/README.md +1 -1
  5. package/docs/application/aws-resource-coverage.md +26 -0
  6. package/docs/application/aws-resource-lifecycle-management.md +13 -23
  7. package/docs/application/cli-workflow.md +1 -1
  8. package/docs/application/engine-design.md +2 -2
  9. package/docs/application/generation-architecture.md +10 -45
  10. package/docs/application/resource-command-policy-stage.md +2 -2
  11. package/docs/application/resource-graph.md +1 -1
  12. package/docs/application/resource-lifecycle-tracker.md +1 -9
  13. package/docs/application/resource-mapping.md +4 -9
  14. package/docs/application/resource-operations.md +4 -2
  15. package/docs/application/tracing.md +2 -6
  16. package/docs/development/code-documentation.md +2 -0
  17. package/docs/development/effect-native-development.md +44 -0
  18. package/docs/development/linting.md +1 -1
  19. package/docs/development/review-code.md +22 -6
  20. package/docs/development/review-remediation-spec.md +28 -37
  21. package/docs/development/spec-writing.md +1 -1
  22. package/docs/development/testing.md +23 -9
  23. package/docs/operations/observability-sop.md +11 -17
  24. package/docs/operations/releasing.md +3 -1
  25. package/examples/README.md +3 -26
  26. package/examples/commands.ts +2 -36
  27. package/examples/queue/application.ts +8 -2
  28. package/examples/state-machine/application.ts +3 -1
  29. package/package.json +40 -46
  30. package/providers/aws/README.md +21 -0
  31. package/providers/aws/awsEnvironment.ts +114 -0
  32. package/providers/aws/generated/managementRegistry.ts +136 -0
  33. package/{src/providers/aws/resources/generated/native/apigatewayv2/api/index.ts → providers/aws/generated/resources/apigatewayv2/api.ts} +13 -50
  34. package/{src/providers/aws/resources/generated/native/apigatewayv2/integration/index.ts → providers/aws/generated/resources/apigatewayv2/integration.ts} +13 -37
  35. package/{src/providers/aws/resources/generated/native/apigatewayv2/route/index.ts → providers/aws/generated/resources/apigatewayv2/route.ts} +23 -40
  36. package/{src/providers/aws/resources/generated/native/apigatewayv2/stage/index.ts → providers/aws/generated/resources/apigatewayv2/stage.ts} +13 -38
  37. package/providers/aws/generated/resources/iam/accesskey.ts +184 -0
  38. package/{src/providers/aws/resources/generated/native/iam/group/index.ts → providers/aws/generated/resources/iam/group.ts} +13 -38
  39. package/{src/providers/aws/resources/generated/native/iam/grouppolicy/index.ts → providers/aws/generated/resources/iam/grouppolicy.ts} +29 -59
  40. package/{src/providers/aws/resources/generated/native/iam/instanceprofile/index.ts → providers/aws/generated/resources/iam/instanceprofile.ts} +13 -41
  41. package/{src/providers/aws/resources/generated/native/iam/managedpolicy/index.ts → providers/aws/generated/resources/iam/managedpolicy.ts} +13 -95
  42. package/providers/aws/generated/resources/iam/oidcprovider.ts +314 -0
  43. package/{src/providers/aws/resources/generated/native/iam/policy/index.ts → providers/aws/generated/resources/iam/policy.ts} +13 -28
  44. package/{src/providers/aws/resources/generated/native/iam/role/index.ts → providers/aws/generated/resources/iam/role.ts} +13 -47
  45. package/{src/providers/aws/resources/generated/native/iam/rolepolicy/index.ts → providers/aws/generated/resources/iam/rolepolicy.ts} +29 -59
  46. package/providers/aws/generated/resources/iam/samlprovider.ts +463 -0
  47. package/providers/aws/generated/resources/iam/servercertificate.ts +465 -0
  48. package/providers/aws/generated/resources/iam/servicelinkedrole.ts +187 -0
  49. package/{src/providers/aws/resources/generated/native/iam/user/index.ts → providers/aws/generated/resources/iam/user.ts} +13 -38
  50. package/{src/providers/aws/resources/generated/native/iam/userpolicy/index.ts → providers/aws/generated/resources/iam/userpolicy.ts} +29 -59
  51. package/{src/providers/aws/resources/generated/native/iam/usertogroupaddition/index.ts → providers/aws/generated/resources/iam/usertogroupaddition.ts} +13 -27
  52. package/providers/aws/generated/resources/iam/virtualmfadevice.ts +298 -0
  53. package/{src/providers/aws/resources/generated/native/kms/key/index.ts → providers/aws/generated/resources/kms/key.ts} +13 -41
  54. package/{src/providers/aws/resources/generated/native/lambda/function/index.ts → providers/aws/generated/resources/lambda/function.ts} +13 -63
  55. package/{src/providers/aws/resources/generated/native/lambda/permission/index.ts → providers/aws/generated/resources/lambda/permission.ts} +13 -55
  56. package/{src/providers/aws/resources/generated/native/s3/bucket/index.ts → providers/aws/generated/resources/s3/bucket.ts} +14 -104
  57. package/{src/providers/aws/resources/generated/native/sns/topic/index.ts → providers/aws/generated/resources/sns/topic.ts} +14 -29
  58. package/{src/providers/aws/resources/generated/native/sqs/queue/index.ts → providers/aws/generated/resources/sqs/queue.ts} +14 -38
  59. package/{src/providers/aws/resources/generated/native/stepfunctions/statemachine/index.ts → providers/aws/generated/resources/stepfunctions/statemachine.ts} +15 -58
  60. package/providers/aws/management/mappings/iam/group.ts +63 -0
  61. package/providers/aws/management/mappings/iam/iamIdentity.ts +41 -0
  62. package/providers/aws/management/mappings/iam/iamLifecycleSettings.ts +8 -0
  63. package/providers/aws/management/mappings/iam/inlinePolicies.ts +159 -0
  64. package/providers/aws/management/mappings/iam/instanceProfile.ts +77 -0
  65. package/providers/aws/management/mappings/iam/oidcProvider.ts +94 -0
  66. package/providers/aws/management/mappings/iam/role.ts +74 -0
  67. package/providers/aws/management/mappings/iam/samlProvider.ts +98 -0
  68. package/providers/aws/management/mappings/iam/serverCertificate.ts +72 -0
  69. package/providers/aws/management/mappings/iam/user.ts +61 -0
  70. package/providers/aws/management/mappings/iam/userToGroupAddition.ts +75 -0
  71. package/providers/aws/management/operations/iam/accessKey.ts +206 -0
  72. package/providers/aws/management/operations/iam/managedPolicy.ts +491 -0
  73. package/providers/aws/management/operations/iam/policy.ts +476 -0
  74. package/providers/aws/management/operations/iam/serviceLinkedRole.ts +172 -0
  75. package/providers/aws/management/operations/iam/virtualMfaDevice.ts +253 -0
  76. package/providers/aws/management/resourceAssociationConfiguration.ts +112 -0
  77. package/providers/aws/management/resourceAssociationRegistration.ts +349 -0
  78. package/providers/aws/management/resourceAssociations.ts +168 -0
  79. package/{src/providers → providers}/aws/management/resourceConfiguration.ts +24 -26
  80. package/providers/aws/management/resourceLifecycleRegistration.ts +540 -0
  81. package/providers/aws/management/resourceManagementModule.ts +31 -0
  82. package/providers/aws/management/resourceManagementRegistry.ts +62 -0
  83. package/providers/aws/management/resourceMapping.ts +84 -0
  84. package/providers/aws/management/resourceOperation.ts +134 -0
  85. package/providers/aws/management/resourceTagOperations.ts +108 -0
  86. package/providers/aws/management/resourceTiming.ts +4 -0
  87. package/providers/aws/runtime.ts +52 -0
  88. package/src/core/resource/resourceCommandPolicy.ts +20 -0
  89. package/src/core/resource/resourceLifecycle.ts +644 -0
  90. package/src/core/resource/resourceStabilization.ts +120 -0
  91. package/src/core/resource/resourceVersions.ts +102 -0
  92. package/src/core/stack/planner.ts +9 -0
  93. package/src/core/stack/resourceStackLifecycle.ts +36 -3
  94. package/src/core/state/resourceState.ts +6 -4
  95. package/src/core/state/stateStore.ts +57 -10
  96. package/src/providers/file/resourcePolicy.ts +13 -12
  97. package/src/providers/providerRuntimeLayer.ts +5 -2
  98. package/src/providers/resourceCommandPolicyLayer.ts +117 -37
  99. package/src/providers/stripe/management/resourcePolicy.ts +22 -11
  100. package/examples/http-echo/application.ts +0 -87
  101. package/src/providers/aws/client/awsClient.ts +0 -418
  102. package/src/providers/aws/client/awsClientConfig.ts +0 -133
  103. package/src/providers/aws/client/awsClientModel.ts +0 -119
  104. package/src/providers/aws/client/awsHttpOperation.ts +0 -153
  105. package/src/providers/aws/client/awsQueryOperation.ts +0 -149
  106. package/src/providers/aws/client/awsRequestSigner.ts +0 -115
  107. package/src/providers/aws/client/awsResponseDecoder.ts +0 -135
  108. package/src/providers/aws/client/awsRetryPolicy.ts +0 -62
  109. package/src/providers/aws/client/generated/apiGatewayV2.ts +0 -3025
  110. package/src/providers/aws/client/generated/cloudControl.ts +0 -5746
  111. package/src/providers/aws/client/generated/iam.ts +0 -10892
  112. package/src/providers/aws/client/generated/lambda.ts +0 -5403
  113. package/src/providers/aws/client/generated/sqs.ts +0 -3769
  114. package/src/providers/aws/client/generated/stepFunctions.ts +0 -1726
  115. package/src/providers/aws/client/openapi/cloudControl/CancelResourceRequest.json +0 -579
  116. package/src/providers/aws/client/openapi/cloudControl/CreateResource.json +0 -1019
  117. package/src/providers/aws/client/openapi/cloudControl/DeleteResource.json +0 -1018
  118. package/src/providers/aws/client/openapi/cloudControl/GetResource.json +0 -883
  119. package/src/providers/aws/client/openapi/cloudControl/GetResourceRequestStatus.json +0 -655
  120. package/src/providers/aws/client/openapi/cloudControl/ListResourceRequests.json +0 -566
  121. package/src/providers/aws/client/openapi/cloudControl/ListResources.json +0 -913
  122. package/src/providers/aws/client/openapi/cloudControl/UpdateResource.json +0 -1027
  123. package/src/providers/aws/cloudControl/client.ts +0 -69
  124. package/src/providers/aws/cloudControl/requestTracker.ts +0 -138
  125. package/src/providers/aws/cloudControl/resourceCommandPolicyLayer.ts +0 -63
  126. package/src/providers/aws/cloudControl/resourceLifecycle.ts +0 -479
  127. package/src/providers/aws/cloudControl/resources/generated/certificatemanager/certificate/index.ts +0 -179
  128. package/src/providers/aws/cloudControl/resources/generated/kms/key/index.ts +0 -362
  129. package/src/providers/aws/cloudControl/resources/generated/s3/bucket/index.ts +0 -2364
  130. package/src/providers/aws/cloudControl/resources/generated/sns/topic/index.ts +0 -326
  131. package/src/providers/aws/cloudControl/resources/generated/sqs/queue/index.ts +0 -307
  132. package/src/providers/aws/cloudControl/resources/generated/sqs/queueinlinepolicy/index.ts +0 -108
  133. package/src/providers/aws/cloudControl/runtime.ts +0 -127
  134. package/src/providers/aws/management/resourceMapping.ts +0 -343
  135. package/src/providers/aws/management/resourceOperation.ts +0 -57
  136. package/src/providers/aws/management/resourcePolicy.ts +0 -549
  137. package/src/providers/aws/management/resourceRegistration.ts +0 -294
  138. package/src/providers/aws/resources/apiGatewayV2/httpApi.ts +0 -327
  139. package/src/providers/aws/resources/generated/native/resourceCommands.ts +0 -152
  140. package/src/providers/aws/resources/iam/grant.ts +0 -150
  141. package/src/providers/aws/resources/iam/grantCommands.ts +0 -283
  142. package/src/providers/aws/resources/iam/policyDocument.ts +0 -30
  143. package/src/providers/aws/resources/iam/policyStatement.ts +0 -59
  144. package/src/providers/aws/resources/iam/role.ts +0 -426
  145. package/src/providers/aws/resources/iam/roleDeclaration.ts +0 -105
  146. package/src/providers/aws/resources/lambda/function.ts +0 -403
  147. package/src/providers/aws/resources/lambda/functionDeclaration.ts +0 -234
  148. package/src/providers/aws/resources/lambda/permission.ts +0 -363
  149. package/src/providers/aws/resources/stepFunctions/stateMachine.ts +0 -95
  150. package/src/providers/aws/runtime.ts +0 -70
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## [0.0.3](https://github.com/Tradedal/nomoss/compare/v0.0.2...v0.0.3) (2026-11-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * prepare Nomoss experimental release ([7bc2186](https://github.com/Tradedal/nomoss/commit/7bc21868cd1f72166aff12cb33adeb52ffee1aa4))
9
+ * separate application stack composition ([4841c7d](https://github.com/Tradedal/nomoss/commit/4841c7d3caed064867b36ab8a44c822ebd76d37e))
10
+ * separate application stack composition ([aae61c4](https://github.com/Tradedal/nomoss/commit/aae61c4797f5e3652c0006d3fd575a49c3325fa8))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * validate source correction paths through one lookup ([d44d90e](https://github.com/Tradedal/nomoss/commit/d44d90ee470ddb5578a236782be813532d488965))
16
+
17
+ ## [0.0.2](https://github.com/Tradedal/nomoss/compare/v0.0.1...v0.0.2) (2026-07-18)
18
+
19
+
20
+ ### Highlights
21
+
22
+ * Initial public Nomoss package release, with the `nomoss` executable and GitHub Actions trusted npm publishing.
23
+ * Effect-native planning, AWS resource reconciliation, and Stripe resource declarations use explicit provider operations and immutable collections.
24
+
25
+ ### Compatibility
26
+
27
+ * No public API or resource-behavior changes.
package/README.md CHANGED
@@ -2,15 +2,9 @@
2
2
 
3
3
  ## Declarative TypeScript resources from OpenAPI
4
4
 
5
- Nomoss (as in “don’t let your infra grow moss”) is an infrastructure management tool. Unlike IaC tools with handwritten resource definitions, Nomoss generates TypeScript SDKs and resource definitions from provider specifications.
5
+ Nomoss is an infrastructure management tool. It generates TypeScript resource declarations and clients from provider specifications so applications use the provider's types and validation rules.
6
6
 
7
- Nomoss has distinct advantages over traditional IaC:
8
-
9
- - Resource authors reuse the provider's validation rules. They write custom code only for rules the specification leaves out.
10
- - When a provider changes a field, resource authors can update the source specification and regenerate the affected TypeScript types and validators together.
11
- - New resources take only a few hours for an agent to add with tokens usage minimized
12
-
13
- Nomoss uses [Effect](https://effect.website/) to compile OpenAPI specifications into typed clients with runtime validation. Its core calls those clients to bring deployed resources into line with their declarations.
7
+ The stack uses shared lifecycle services to apply the declarations. A resource definition selects the provider operations and supplies the mappings those operations need. A provider rule that requires its own decisions or sequence can use a typed [Effect](https://effect.website/) operation. When the provider specification changes, contributors can regenerate the corresponding types and validators together.
14
8
 
15
9
  ```mermaid
16
10
  ---
@@ -44,7 +38,7 @@ flowchart LR
44
38
 
45
39
  Experimental version.
46
40
 
47
- Goal: beta version with full AWS and Stipe resources coverage and 0 AWS SDK dependencies. SDK generated packages separate publish.
41
+ The beta goal is full AWS and Stripe resource coverage, with no AWS SDK dependencies. Nomoss plans to publish the generated clients as separate packages.
48
42
 
49
43
  ## Demo
50
44
 
@@ -55,14 +49,10 @@ Goal: beta version with full AWS and Stipe resources coverage and 0 AWS SDK depe
55
49
  Run `yarn nomoss --help` to list the example stacks. Pass the stack name before the command.
56
50
 
57
51
  ```sh
58
- yarn nomoss queue diff # Preview the proposed changes
59
- yarn nomoss queue create # Deploy a new stack
60
- yarn nomoss queue update # Apply changes to a deployed stack
61
- yarn nomoss queue reconcile # Refresh saved state from AWS
62
- yarn nomoss queue delete # Remove the stack's managed resources
52
+ yarn nomoss queue diff
63
53
  ```
64
54
 
65
- The [CLI guide](docs/application/cli-workflow.md) covers detailed diffs, live progress, and saved state.
55
+ For stacks that support deployment, use `create` to deploy, `update` to apply changes, `reconcile` to refresh saved state, and `delete` to remove managed resources. The [example guide](examples/README.md) lists the commands each example supports. The [CLI guide](docs/application/cli-workflow.md) explains plan review, progress, and saved state.
66
56
 
67
57
  ## Documentation
68
58
 
package/ROADMAP.md CHANGED
@@ -8,6 +8,8 @@ Generated clients and resource definitions drive live AWS and Stripe deployments
8
8
 
9
9
  The goal is full AWS and Stripe resource coverage through the TypeScript declaration API. Applications can pass related resources directly, grant permissions through resource methods, and manage nested Stripe resources across deployments.
10
10
 
11
+ The [AWS provider resource coverage list](docs/application/aws-resource-coverage.md) records support for every resource type in the checked-in CloudFormation Registry catalog.
12
+
11
13
  ## Beta
12
14
 
13
15
  The generated SDKs ship separately from the stack engine so applications can use either the provider API or the full deployment workflow. The runtime has zero external SDK dependencies. It uses Smithy-generated AWS clients and protocol code, resolves and refreshes its own credentials, and signs requests through a standalone SigV4 implementation.
package/docs/README.md CHANGED
@@ -10,7 +10,7 @@ For provider generation, read the [generation architecture](application/generati
10
10
 
11
11
  Create and maintain development trackers with the [tracker template](../attempts/tracker-template.md). It defines how to capture scope, direction, delivered outcomes, and the work that remains.
12
12
 
13
- Use the [Effect development guide](development/effect-native-development.md) when implementing services. Follow the [code documentation contract](development/code-documentation.md) for source comments and the [specification guide](development/spec-writing.md) for requirements. Review documentation with the [remediation checklist](development/review-docs.md) and [writing guidance](development/unslop.md).
13
+ Follow the [resource management development guide](development/effect-native-development.md#develop-resource-management) to define a lifecycle and decide which parts come from provider specifications. The [native AWS generator procedure](../tools/awsServiceResources/README.md) explains how to produce the declarations and client operations. Follow the [code documentation contract](development/code-documentation.md) for source comments and the [specification guide](development/spec-writing.md) for requirements. Review documentation with the [remediation checklist](development/review-docs.md) and [writing guidance](development/unslop.md).
14
14
 
15
15
  Use the [test contract](development/testing.md) to select behavior coverage and the [graph test approach](development/resource-graph-testing-approach.md) when testing resource dependencies. Run checks according to the [lint workflow](development/linting.md). Complete changes under the [review contract](development/review-remediation-spec.md) and write commits under the [commit message specification](development/commit-message-spec.md).
16
16
 
@@ -0,0 +1,26 @@
1
+ # AWS provider resource coverage
2
+
3
+ Nomoss manages the IAM resources listed below through native AWS operations. The [declaration manifest](../../tools/awsServiceResources/sources/resources.json) also lists resources that applications can declare while their native lifecycle is still under development.
4
+
5
+ ## IAM
6
+
7
+ Nomoss generates declarations for all 16 IAM types. The native integration suite verifies that a stack can create each type, read it from saved state, and remove it from AWS. The policy cases also verify changes to documents and principals.
8
+
9
+ | Resource type | Coverage |
10
+ | --- | --- |
11
+ | `AWS::IAM::Group` | The stack manages a group with a name and path. Separate declarations manage its inline policies and selected memberships. |
12
+ | `AWS::IAM::Role` | The stack creates a role with a trust policy and reads the trust document from IAM. |
13
+ | `AWS::IAM::User` | The stack manages a user with a name and path. Separate declarations manage its inline policies, access keys, and group memberships. |
14
+ | `AWS::IAM::GroupPolicy` | The stack applies an inline policy to one group and verifies its document. |
15
+ | `AWS::IAM::RolePolicy` | The stack applies an inline permissions policy to one role. The live STS case verifies that the source role is denied before the grant, can assume the target role after apply, and runs a signed request as the target session. |
16
+ | `AWS::IAM::UserPolicy` | The stack applies an inline policy to one user and verifies its document. |
17
+ | `AWS::IAM::AccessKey` | The stack issues a key for a declared user and confirms the requested inactive status. |
18
+ | `AWS::IAM::InstanceProfile` | The stack attaches a declared role after IAM creates the profile. Teardown removes that role from the profile before it deletes the profile. |
19
+ | `AWS::IAM::ManagedPolicy` | The stack confirms the default policy document and the attached principals. The live case changes both and continues to publish revisions after IAM reaches its five-version limit. |
20
+ | `AWS::IAM::OIDCProvider` | The stack verifies the issuer URL, client ID list, and thumbprints. |
21
+ | `AWS::IAM::Policy` | The stack manages inline copies on selected principals. The live cases confirm that a policy can move from a user to a group and a role, and that a conflicting create leaves the original document intact. |
22
+ | `AWS::IAM::SAMLProvider` | The stack creates a provider with SAML metadata and verifies its encryption mode. |
23
+ | `AWS::IAM::ServerCertificate` | The stack uploads a certificate and verifies the name and path in IAM's certificate metadata. |
24
+ | `AWS::IAM::ServiceLinkedRole` | The stack waits for IAM to confirm that its deletion task succeeded. |
25
+ | `AWS::IAM::UserToGroupAddition` | The stack verifies the selected users in their group and removes those memberships on teardown. |
26
+ | `AWS::IAM::VirtualMFADevice` | The stack manages an unassigned virtual MFA device. Enrollment requires authenticator codes and takes place separately. |
@@ -4,54 +4,44 @@ The AWS resource contract gives applications typed Effect services to declare re
4
4
 
5
5
  ## Declare AWS resources
6
6
 
7
- The AwsResourceDefinitionCompiler generates input and output schemas from CloudFormation Registry definitions and relationship metadata. A provider.Resource(props) declaration registers its schema and returns a typed entity for use in compatible resource properties. Its inputs describe what the application controls. Its outputs describe what AWS supplies.
7
+ AWS resource generators use CloudFormation Registry definitions and relationship metadata to produce input and output schemas. A resource declaration registers its schema and returns a typed entity that the application can pass to compatible resource properties. Its inputs describe what the application controls. Its outputs describe what AWS supplies.
8
8
 
9
9
  Generated schemas preserve required properties and nested definitions. Registry annotations identify each resource and distinguish read-only, write-only, and create-only properties. The planner uses those classifications to select an action, and the state service retains values that future reads may omit.
10
10
 
11
11
  In the relationship contract, the application passes a resource entity. Its schema restricts the source type and identifies which applied values the AWS request needs. Core checks the registered source, waits for it to apply, and validates the resolved request before mutation. AWS declarations still need entity inputs wherever generation lacks this metadata. [resource graph contract](resource-graph.md)
12
12
 
13
- A relationship identifies a dependency. The resource policy defines which principal receives a grant, where the permission belongs, and how to configure the affected resources. The same core contract covers relationships across providers, nested properties, and requests that need several outputs. Applications can also read an AWS output directly.
13
+ A relationship identifies a dependency and the values a request needs. The resource policy decides which provider actions the dependency requires. The same core contract covers relationships across providers, nested properties, and requests that need several outputs. Applications can also read an AWS output directly.
14
14
 
15
15
  ## Generate AWS operations
16
16
 
17
- The official AWS Smithy models define Cloud Control requests and responses. Smithy's OpenAPI converter and a registered Smithy2OpenApiExtension convert them to OpenAPI 3.1 for AwsCloudControlClientGenerator. Effect normalizes component schemas to JSON Schema Draft 2020-12 and compiles them through SchemaRepresentation. [official AWS Smithy definitions](https://github.com/aws/api-models-aws) · [official OpenAPI converter](https://smithy.io/2.0/guides/model-translations/converting-to-openapi.html)
17
+ The official AWS Smithy models define requests and responses for native service APIs and Cloud Control. Nomoss uses Smithy's OpenAPI converter and protocol extensions to produce OpenAPI 3.1 documents. Effect normalizes the component schemas to JSON Schema Draft 2020-12 and compiles them through SchemaRepresentation. [Official AWS Smithy definitions](https://github.com/aws/api-models-aws) · [Official OpenAPI converter](https://smithy.io/2.0/guides/model-translations/converting-to-openapi.html)
18
18
 
19
19
  The generated client needs the model's execution traits as well as its payload schemas. OpenAPI extensions carry those traits into TypeScript so a request reaches the correct region with the correct signature and follows AWS rules for idempotency, pagination, and retries.
20
20
 
21
21
  Cloud Control uses AWS JSON RPC 1.0. All operations share POST / and application/x-amz-json-1.0. X-Amz-Target identifies the operation. Since OpenAPI identifies operations by method and path, Smithy's converter creates a document with component schemas for each operation. The AWS JSON extension describes its request and response.
22
22
 
23
- Contributors can compile TypeScript from the versioned OpenAPI documents in src/providers/aws/client/openapi/cloudControl. Regeneration replaces the previous service documents reproducibly. The generator checks the pinned converter dependencies against their checksums. Generator changes require the upstream sources and guides in refs/smithy and refs/aws-api-models.
23
+ The generator checks the Smithy converter dependencies against their pinned checksums. It removes the intermediate OpenAPI documents when compilation finishes. The resulting clients and their package manifests live under [providers/aws/generated/clients](../../providers/aws/generated/clients/).
24
24
 
25
25
  The generator constructs and transforms the complete TypeScript module through ts-morph and TypeScript AST operations. That rule also covers documentation and exports.
26
26
 
27
- Support for an additional AWS capability requires the protocol behavior in its Smithy models. This applies to authentication calls as well as service requests, including any model-specific wire format, stream, or checksum.
27
+ The client must honor the Smithy protocol for each new AWS capability. Authentication calls and service requests can require a particular wire format, stream, or checksum.
28
28
 
29
29
  ## Execute AWS requests
30
30
 
31
- Resource services and generated operations compose public client methods for credential resolution, request signatures, HTTP execution, and retries. Callers can use and test each capability independently. Each method owns its validation and execution and returns a named domain result. [Effect development contract](../development/effect-native-development.md)
31
+ Generated operations use the shared AWS client. A resource service can call those operations through the same Effect runtime that supplies credentials and HTTP transport. Applications that supply credentials independently can use the [AWS package guide](../../providers/aws/README.md).
32
32
 
33
- The generated input schema validates and encodes a request. Before serialization the client resolves the service address, sets generated headers, and supplies any absent modeled idempotency token. The generated output schema decodes a successful response. Callers that compose HTTP contracts directly use the same public methods.
33
+ The client validates input against the generated schema before sending a request. It applies the service's address rules to the selected region and fills in an idempotency token when the operation declares one and the caller omits it. The generated output schema validates the response before the caller receives it.
34
34
 
35
- AwsRequestSigner takes the serialized HTTP request with its generated headers, Nomoss credentials, region, and signing name. It returns a SigV4-signed request. Only the signer imports @smithy/signature-v4 and SHA-256 from @smithy/core/checksum, with @smithy/types and tslib as dependencies. Its public contract exposes Nomoss types.
35
+ Clients use SigV4 for operations that require it. Each retry signs with the credentials available for that attempt and sends the same payload and idempotency token. The retry policy honors AWS retry hints within the configured attempt limit. Interruption stops local requests and retry waits.
36
36
 
37
- Retries reuse the prepared payload and idempotency token. Credentials can refresh before the next signature. AwsRetryPolicy applies backoff and AWS retry hints up to the configured attempt limit. A provider failure retains enough detail to decide whether to retry and to explain the failure to the caller. Fiber interruption stops local requests and waits.
37
+ For an IAM Identity Center profile, run `aws sso login --profile <profile>` and set `AWS_PROFILE` to that profile. Nomoss obtains credentials for the configured account and role. If the cached access token expires, Nomoss can renew it when the profile uses a named session and the cache has a valid refresh token. Sign in again if the provider cannot renew the token. [IAM Identity Center provider](../../providers/aws/credentials/awsIdentityCenter.ts)
38
38
 
39
- Applications supply configuration and HTTP transport through one Layer graph. Tests can replace those dependencies and exercise the same generated calls, request tracker, and resource lifecycle as production. The AWS package exports the contracts, services, and Layers for that composition.
40
-
41
- Saved provider metadata selects the registered resource policy. The registration stays in scope throughout execution so every read and planned change uses the application's AWS configuration.
42
-
43
- The target runtime resolves service addresses and credentials through generated contracts and internal Effect services. The dependency restriction covers generated AWS service libraries, @aws-sdk/core, and @aws-sdk/credential-provider-node in dependencies and generated imports. Existing imports still need replacements that preserve supported authentication flows and credential refresh.
44
-
45
- ## Wait for Cloud Control results
46
-
47
- A Cloud Control request embeds a Registry-validated resource document. The Smithy operation schemas govern the enclosing request and response.
48
-
49
- AWS can accept a change before it completes. Nomoss follows the request token to a terminal result. After a successful create or update it reads the resource by provider identifier. Only a model that passes the generated output schema becomes saved state or input to another resource.
50
-
51
- A read or change requires the identity and metadata its operation defines. Absent request tokens or required result data produce tagged failures. Discovery follows the generated pagination contract. Interruption stops local HTTP work and waits. An accepted remote request requires a separate AWS cancellation operation.
39
+ The AWS runtime uses generated Nomoss clients and Effect services for request execution. AWS SDK and JavaScript Smithy packages are outside the runtime dependency graph. The [runtime dependency tracker](../../attempts/dev-attempts_aws-runtime-dependencies.md#tasks) records the remaining coverage for credential sources, service addresses, and AWS Query.
52
40
 
53
41
  ## Resource policy and recovery
54
42
 
55
43
  Before a change, the resource policy establishes the provider identity and defines when Nomoss can adopt or replace the object. The plan respects dependencies. Saved state retains what reconciliation and recovery require, subject to the resource's retention rules for values AWS cannot reproduce.
56
44
 
57
- A resource policy can use additional generated AWS operations through the internal client when Cloud Control lacks required behavior. The resource or operation contract defines its time limits, retry policy, output conversion, and recovery rules. The CLI presents the resulting plan and progress. [CLI contract](cli-workflow.md)
45
+ A resource policy selects the native AWS operations for its lifecycle. The operation contract defines how Nomoss interprets requests and responses. The lifecycle defines how long to wait for confirmation and which failures permit a retry or require recovery. The CLI presents the resulting plan and progress. [CLI contract](cli-workflow.md)
46
+
47
+ Saved Cloud Control records remain readable for inspection. Stack commands reject those records because their identifiers were issued for a different API and cannot be used to change or remove native AWS resources.
@@ -53,7 +53,7 @@ Stack "native-queue"
53
53
 
54
54
  Both commands display the plan before execution. An update lists deletions first. The plan captures its resources and dependencies. A subsequent change to saved state invalidates the plan before any provider mutation. Even a change to an operation's status requires a new plan.
55
55
 
56
- Use `Asset.fromPath` for a file or directory and `Asset.fromBuild` for a source entry point and its build settings. Diff, create, and update prepare each asset and record its SHA-256 digest in the plan. Detailed output shows the source and digest. Apply uses the exact bytes from that plan. To deploy a later edit, prepare a new plan. Dependency inspection, state inspection, reconcile, and delete require no source build or package. [Asset API](../../src/core/asset.ts) · [HTTP echo declaration](../../examples/http-echo/application.ts)
56
+ Use `Asset.fromPath` for a file or directory and `Asset.fromBuild` for a source entry point and its build settings. Diff, create, and update prepare each asset and record its SHA-256 digest in the plan. Detailed output shows the source and digest. Apply uses the exact bytes from that plan. To deploy a later edit, prepare a new plan. Dependency inspection, state inspection, reconcile, and delete require no source build or package. [Asset API](../../src/core/asset.ts)
57
57
 
58
58
  When a change requires replacement, the plan identifies the resource to replace and shows the order of its creation and removal operations. A resumed plan lists the operations that still need to run. Dependency values are resolved again during execution, and an unchanged request preserves the current resource.
59
59
 
@@ -20,7 +20,7 @@ The planner uses generated mutability metadata and provider semantics to decide
20
20
 
21
21
  ## Provider capabilities
22
22
 
23
- Cloud Control provides the generic lifecycle for supported AWS types. A provider service that needs additional AWS operations calls their generated Smithy contracts through the internal client. [AWS resource contract](aws-resource-lifecycle-management.md)
23
+ A resource's type identifies its management definition. That definition selects the provider operations and supplies the mappings and rules the stack needs to confirm a change and preserve ownership. AWS resources execute generated operations for their native service API through the internal client. See the [AWS resource contract](aws-resource-lifecycle-management.md).
24
24
 
25
25
  Public service methods let a lifecycle compose provider capabilities. Each capability defines schemas for its data and returns typed failures that explain unsuccessful calls. Layers supply the dependencies those methods require. [Effect development contract](../development/effect-native-development.md)
26
26
 
@@ -40,4 +40,4 @@ The public API covers the application stack lifecycle, from declaration and plan
40
40
 
41
41
  The core validates related resource entities, retains their request mappings in saved state, and obtains current source values before dependent mutations. Generated Stripe inputs enforce resource types at resolved relationship paths. AWS entity inputs and unresolved provider relationships remain unfinished, so applications cannot assume that every generated property supports this workflow.
42
42
 
43
- Each resource needs a contract that identifies which Cloud Control operations it supports. The contract also establishes identity across execution contexts so Nomoss can adopt the intended object, recover after interruption, and destroy only the object it owns. Those decisions remain open for resource types without such a contract.
43
+ Each managed resource needs a contract that defines the identity and provider operations for its lifecycle. A later run uses that identity to recover after interruption and remove only the object the stack owns. Adoption requires evidence that matches the contract. The [AWS coverage reference](aws-resource-coverage.md) records which resource types have verified management.
@@ -10,48 +10,13 @@ CloudFormation Registry defines which AWS properties an application controls and
10
10
 
11
11
  ## AWS resource declarations and operation clients
12
12
 
13
- The generated `AWSQueue` function lets an application declare its desired SQS queue. The SQS client exposes methods such as `createQueue` and `getQueueAttributes` for the API calls that manage that queue.
13
+ CloudFormation Registry defines a resource's properties, identity, and changes that require replacement. Smithy defines the service operations and their errors. Nomoss verifies the revision and checksum of the Registry definitions and service models selected in the manifests. The [native AWS generator procedure](../../tools/awsServiceResources/README.md) explains how to select and regenerate those inputs.
14
14
 
15
- ```text
16
- CloudFormation Queue definition → resource generator → AWSQueue
17
- Smithy SQS service model → client generator → SQS operation client
18
- ```
19
-
20
- CloudFormation Registry defines the properties and identity of AWS::SQS::Queue and the changes that require replacement. The SQS Smithy model defines the API contract, including service errors. The resource manifest pins Registry definitions by revision and checksum. The SQS manifest selects the service model. Before generation, `AwsServiceResourceSources` verifies the selected source contents. [Smithy model for Amazon SQS](../../refs/aws-api-models/models/sqs/service/2012-11-05/sqs-2012-11-05.json) · [resource source manifest](../../tools/awsServiceResources/sources/resources.json) · [SQS source manifest](../../tools/awsServiceResources/sources/sqs.json)
21
-
22
- The AwsServiceResourceDeclarations service generates `AWSQueue` from the Queue definition. When an application calls that function, it registers the desired queue with the core `ResourceGraphBuilder` service and returns its entity. [resource-generation service, AwsServiceResourceDeclarations](../../tools/awsServiceResources/resourceDeclarations.ts)
23
-
24
- ```ts
25
- const queue = yield* AWSQueue({
26
- logicalId: "Events",
27
- props: { VisibilityTimeout: 45 },
28
- });
29
- ```
15
+ The declaration generator uses the Registry schema and imported relationships to produce a function that accepts resource properties. The function registers the resource with its logical ID and returns an entity that other declarations can reference before the provider assigns an ID.
30
16
 
31
- The logical ID `"Events"` gives core a stable identity within the stack. The `VisibilityTimeout` property specifies the desired queue setting. The Queue resource entity lets another resource declaration depend on the queue before AWS assigns the queue's URL and ARN.
32
-
33
- The generated `AWSBucket` function accepts the Queue entity as a notification destination. The bucket declaration below selects that queue for S3 object creation events.
34
-
35
- ```ts
36
- const bucket = yield* AWSBucket({
37
- logicalId: "Uploads",
38
- props: {
39
- NotificationConfiguration: {
40
- QueueConfigurations: [
41
- { Event: "s3:ObjectCreated:*", Queue: queue },
42
- ],
43
- },
44
- },
45
- });
46
- ```
47
-
48
- The [resource metadata importer, AwsResourceMetadataImporter](../../tools/awsResources/awsResourceMetadata.ts), obtains the S3-to-SQS relationship from the selected definitions and relationship records. The relationship identifies the SQS Queue's `Arn` output as the value accepted by the S3 Bucket's notification `Queue` property. The resource-generation service uses the relationship to produce a declaration schema that accepts the Queue resource entity at that property.
49
-
50
- ```text
51
- Queue entity in Bucket properties → recorded dependency → ARN in resolved Bucket request
52
- ```
17
+ Each resolved relationship identifies which output supplies a dependent property. Core records the dependency, waits for the source to apply, and supplies the validated output to the dependent request. The Registry still governs the resolved property value. The [resource graph contract](resource-graph.md) explains how references work across resources and providers.
53
18
 
54
- Core uses the recorded dependency to plan resource changes. The `ResourceOutputResolver` service substitutes the saved queue ARN when it prepares the bucket request. The generated request schema validates the resolved bucket properties against the original CloudFormation Registry constraints. Native notification delivery and the permissions it requires are tracked in the [AWS resource tracker](../../attempts/dev-attempts_aws-smithy-resource-generation.md).
19
+ The client generator uses Smithy to produce typed operations. A resource can have a declaration and client operations before Nomoss supports its lifecycle. See the [AWS coverage reference](aws-resource-coverage.md) for current support.
55
20
 
56
21
  ## Provider contracts and resource metadata
57
22
 
@@ -171,13 +136,13 @@ flowchart TB
171
136
 
172
137
  ### Resource identity and lifecycle support
173
138
 
174
- Registry defines AWS resource identity and property classifications. Smithy supplies operation contracts for native policies and Cloud Control. A subsequent Cloud Control request needs the opaque Identifier returned with the resource model, so Nomoss retains it separately from the model's identity fields. A declaration can execute only when the runtime supplies a policy for its type.
139
+ Registry defines AWS resource identity and property classifications. Smithy supplies operation contracts for native policies. A declaration can execute only when the runtime supplies a policy for its type.
175
140
 
176
141
  Local declarations compile the selected fields directly from their canonical Effect schemas to preserve application validation. A local file resource saves its output path as its identity for later reads.
177
142
 
178
143
  ## Discovery through the schema graph
179
144
 
180
- The catalog retains the source schema graph, including array items, alternatives, and expansion targets. Recursive references point to their original definitions. Each operation binding and relationship records where its request parameters and response fields came from. [OpenApiResourceGraph type](../../tools/codegen/resourceDiscoverySchemas.ts)
145
+ The catalog retains array items, alternatives, and expansion targets from the source schema graph. Recursive references point to their original definitions. Each operation binding and relationship records where its request parameters and response fields came from. [OpenApiResourceGraph type](../../tools/codegen/resourceDiscoverySchemas.ts)
181
146
 
182
147
  ```mermaid
183
148
  ---
@@ -235,11 +200,11 @@ A declaration can contain local lifecycle properties alongside its provider requ
235
200
 
236
201
  ## Provider directory organization
237
202
 
238
- A provider keeps its API client and generated contracts in client/. Shared policies in management/ execute generated registrations. Each resource owns its declarations, schemas, and native operations in `resources/<resource>/`. The provider's runtime.ts assembles Layers and index.ts exports the public API. A handwritten operation documents which behavior the generator lacks.
203
+ AWS publishes one client package per service from [providers/aws/generated/clients](../../providers/aws/generated/clients/). Nomoss uses those packages to make AWS calls during stack operations. The [AWS provider guide](../../providers/aws/README.md) shows where to change a service's client, resource declarations, or lifecycle. See the [resource management development guide](../development/effect-native-development.md#develop-resource-management) for the requirements for definitions and type-based resolution.
239
204
 
240
205
  A change to the provider directory layout preserves public imports, saved command identities, and output names. Generator imports and native schema registrations use the new locations, as do examples and fixtures. Regeneration and application execution thus use the same contracts.
241
206
 
242
- A generated policy takes over once production registrations use its configuration and the shared service handles the same requests, responses, and failures. At that point the superseded policy and its runtime overrides and wrappers can be removed.
207
+ A generated definition can replace handwritten code once the shared lifecycle handles the same requests, results, and failures. Keep provider decisions that still need code with the operation that owns them.
243
208
 
244
209
  An integration case follows the managed object through its provider result, saved identity, and dependent outputs. It exercises recovery after failure and confirms removal at teardown. Review identifies which handwritten policies and overrides the generated operation replaces.
245
210
 
@@ -295,7 +260,7 @@ flowchart TB
295
260
 
296
261
  Core prepares each declared asset when it constructs the plan. The Assets service builds or packages the source, records its SHA-256 digest in the resource properties, and retains the bytes for apply in the same runtime. A later edit requires a new plan to deploy the changed source. State inspection and deletion require no local build. [Assets service](../../src/core/asset.ts)
297
262
 
298
- The dispatcher selects the resource policy from its registered metadata. Native AWS policies call generated service clients. The Cloud Control runtime executes Cloud Control operations. Stripe policies call generated clients or native local resource operations. Each policy translates the declaration and determines when the provider operation has completed. [provider dispatcher](../../src/providers/resourceCommandPolicyLayer.ts)
263
+ The dispatcher selects the resource policy from its registered metadata. AWS policies call generated service clients. Stripe policies call generated clients or native local resource operations. Each policy translates the declaration and determines when the provider operation has completed. [provider dispatcher](../../src/providers/resourceCommandPolicyLayer.ts)
299
264
 
300
265
  The live renderer counts actual outcomes. If a dependent request resolves to its saved inputs, the resource counts as unchanged. After the application evaluates its outputs, the renderer writes the final events and totals. The timer starts after the plan and builds are complete and stops after the last progress write. [live renderer](../../src/core/stack/stackWorkflowRenderer.ts) · [CLI workflow](cli-workflow.md)
301
266
 
@@ -313,7 +278,7 @@ The published catalog has one entry per resource type. Source references identif
313
278
 
314
279
  ## Current limits and acceptance
315
280
 
316
- Stripe uses the provider directory organization described above. Its generated declarations register canonical schemas internally and accept typed resource entities at resolved relationship paths. Core execution checks the source type, obtains its current applied values, and validates the completed request before mutation.
281
+ Generated Stripe declarations register canonical schemas internally and accept typed resource entities at resolved relationship paths. Core checks the source type, obtains its current applied values, and validates the completed request before mutation.
317
282
 
318
283
  Discovery leaves a relationship unresolved if its target is unknown. Native AWS declarations accept entities where imported metadata identifies an unambiguous relationship. For Stripe, generated updates currently share the read identity mapping. A Customer hint defines how to recognize a deleted object, and the local file resource still needs a handwritten policy. During replacement, the reviewed plan orders ordinary lifecycle operations under generated rules. If a command fails, ResourceCommandExecutionFailed retains the underlying provider or validation error. [resource lifecycle requirements](resource-operations.md) · [unified tracker](../../attempts/dev-attempts_unified-resource-generation.md)
319
284
 
@@ -4,7 +4,7 @@ The stack lifecycle sends each resource command to its registered provider polic
4
4
 
5
5
  ## Requests and outcomes
6
6
 
7
- A stable resource key and schema metadata identify the policy for a command. If the policy is absent or lacks the requested operation, the caller receives a tagged failure.
7
+ The resource key identifies the instance, and the provider and type in its schema metadata identify the management definition. A command can use that metadata from saved state after the declaration disappears. If the definition is absent or lacks the requested operation, the caller receives a tagged failure.
8
8
 
9
9
  ResourceObservation describes what a provider read found. PlanDecision records the action the planner selects from desired, saved, and observed state. ResourceCommandResult gives core one result to reconcile, persist, and expose as outputs. [resource model](../../src/core/resource/model.ts) · [lifecycle model](../../src/core/resource/lifecycle.ts)
10
10
 
@@ -18,7 +18,7 @@ A provider policy declares an explicit prerequisite when an operation depends on
18
18
 
19
19
  ## Provider behavior
20
20
 
21
- Cloud Control and generated resource metadata supply the generic AWS lifecycle. A resource policy owns any additional AWS operations and invokes their generated contracts through the internal client. [AWS resource contract](aws-resource-lifecycle-management.md)
21
+ The management definition selects provider operations, identifies the owned object, and defines what confirms a change. Shared lifecycle services execute those rules through the provider client. Where a provider requires a decision or sequence specific to a resource, the shared lifecycle calls a typed operation at that step. See the [resource management development guide](../development/effect-native-development.md#develop-resource-management).
22
22
 
23
23
  A named public service method exposes each provider capability. It accepts domain inputs, owns the decisions that affect the call, and returns a result other services can use. [Effect development contract](../development/effect-native-development.md)
24
24
 
@@ -36,7 +36,7 @@ The canonical state schemas preserve applied nodes and lifecycle records. Saved
36
36
 
37
37
  ResourceStateStore uses Effect's KeyValueStore schema support to validate reads and encode writes. File storage keeps one JSON document per stack under .nomoss/state. Tests use the same service with an in-memory KeyValueStore. The configured secret store governs protected outputs.
38
38
 
39
- Reconciliation reads each managed object by its saved provider identity. Only values that pass the registered output schema can enter saved state or a dependent request. Cloud Control requires both the resource type and its opaque Identifier.
39
+ Reconciliation reads each managed object by its saved provider identity. Only values that pass the registered output schema can enter saved state or a dependent request.
40
40
 
41
41
  ## Acceptance
42
42
 
@@ -28,7 +28,7 @@ The login Keychain is for local development. CI and shared deployments require t
28
28
 
29
29
  Reconciliation refreshes desired resources and any saved resources that still need a read. Provider services read in dependency order and report whether the object exists, is unreadable, or shows unmanaged drift. Their observations retain the evidence the resource policy needs for its decision.
30
30
 
31
- A read requires the identity defined by the provider. Cloud Control uses the saved resource type and provider identifier. Import uses the external identifier supplied for adoption. Provider services execute resource-specific reads through generated contracts.
31
+ A read requires the identity defined by the provider. Import uses the external identifier supplied for adoption. Provider services execute resource-specific reads through generated contracts.
32
32
 
33
33
  The planner proposes creation for an absent desired resource, even if that object previously existed. For a property difference, lifecycle metadata determines whether to update or repair it. Removal from the declaration produces a delete decision for the saved object. Explicit teardown produces destroy decisions. Dependencies determine when an action can run and supply outputs. [command policy contract](resource-command-policy-stage.md)
34
34
 
@@ -41,11 +41,3 @@ During replacement, a logical resource can own several provider instances. Each
41
41
  Each provider defines which values recovery needs and how long to retain them. For example, AWS may omit a generated name or an identifier for an unfinished replacement on subsequent reads.
42
42
 
43
43
  CLI and embedded applications execute the selected plan against its captured graph and state snapshot. A change to a lifecycle record produces ResourcePlanInvalidated before any provider mutation. Application configuration selects the environment and provider context. [CLI contract](cli-workflow.md)
44
-
45
- ## S3-to-SQS event delivery
46
-
47
- The application declares the bucket and queue, authorizes delivery through a queue policy, and configures a bucket notification. The policy uses the bucket identity and the destination uses the queue ARN. Other resources can read the queue's typed ARN and URL.
48
-
49
- Nomoss authorizes S3 delivery before it configures the notification. Destroy removes the stack's notification before it revokes the authorization. Changes preserve policy entries owned outside this integration.
50
-
51
- Resource-specific operations use generated AWS contracts. The acceptance workflow uploads an object, receives its event from SQS, and confirms that teardown removes the managed resources and configuration.
@@ -1,12 +1,10 @@
1
1
  # Resource mapping
2
2
 
3
- An application can declare a Stripe product and its price before either exists in Stripe. The Product declaration returns a typed resource entity. The application passes that entity to the Price declaration, and Nomoss supplies the product's assigned ID when it creates the price.
3
+ A resource mapping identifies the entities a property accepts and the values each entity supplies to a provider request. It also specifies how a later run identifies the object to read or change. The same contract applies to provider and local resources.
4
4
 
5
- A resource mapping identifies the entities a property accepts and the provider values each entity supplies. It also specifies how a later run identifies the object to read or change. The same contract applies to provider resources and to local resources such as BillingConfigurationExport, which writes application configuration to a file.
5
+ ## Example: declare a product and its price
6
6
 
7
- ## Declare related resources before they exist
8
-
9
- Inside an application declaration, the StripeResources service supplies the resource functions used below. The product variable identifies the declared Product even though its Stripe ID is still unavailable.
7
+ An application can declare a Stripe product and its price before either exists in Stripe. The StripeResources service supplies both declarations. The Product declaration returns an entity, and Nomoss supplies its assigned ID when it creates the price.
10
8
 
11
9
  ```ts
12
10
  const stripe = yield* StripeResources;
@@ -34,7 +32,7 @@ After apply, the application can read price.PriceId directly. A read before the
34
32
 
35
33
  ## Validate declarations against the provider's rules
36
34
 
37
- A declaration rejects invalid inputs before a provider mutation. The same source governs TypeScript and runtime validation. For Stripe that source is OpenAPI. AWS uses CloudFormation Registry for resource properties and Smithy for Cloud Control requests. A local resource uses its registered Effect schema.
35
+ A declaration rejects invalid inputs before a provider mutation. The same source governs TypeScript and runtime validation. For Stripe that source is OpenAPI. AWS uses CloudFormation Registry for resource properties and Smithy for requests to native service APIs. A local resource uses its registered Effect schema.
38
36
 
39
37
  Registry classifications determine which AWS properties an application can set or change. AWS supplies read-only values. A change to a create-only property requires replacement. A write-only value needs a retention rule because provider reads omit it. Where Registry leaves mutability or retention open, the resource policy defines the rule before Nomoss applies a change or accepts an observation.
40
38
 
@@ -60,7 +58,6 @@ Stripe's external_account operation can return a bank account or a card. The res
60
58
 
61
59
  Generated identity names can differ from provider parameter names. A Customer read passes CustomerId as customer. A Product read passes ProductId as id. The resource contract maps each saved output to the parameter and preserves the constraints of the source field or creation parameter.
62
60
 
63
- An application declares a queue before AWS assigns QueueUrl, its Registry primary identifier. Cloud Control also returns an opaque Identifier. Later requests require that value and the resource type, so Nomoss saves it separately from the complete observed resource model, even for types without read-only properties. The internal client validates Cloud Control requests and responses against their Smithy contracts. [AWS resource specification](aws-resource-lifecycle-management.md)
64
61
 
65
62
  A mapped read uses the identity from the last successful apply. A new declaration first needs a successful creation and saved identity. ResourceReadIdentityMissing identifies a read without that applied record. Invalid saved outputs stop the request locally. If the response identifies a different object, Nomoss reports ResourceIdentityMismatch and preserves the previous state.
66
63
 
@@ -108,8 +105,6 @@ Small provider documents let maintainers check generated declarations and accept
108
105
 
109
106
  In the billing acceptance workflow, a later run reads the original Product and Price. After price replacement, dependent requests use the new identity. Production lifecycle and state coverage also exercises nested and cross-provider relationships, multi-value mappings, and recovery after reload or failure. An unrelated type stops the dependent mutation. Failed reads and teardown retries preserve the state and secrets needed for recovery. [testing contract](../development/testing.md)
110
107
 
111
- The S3-to-SQS acceptance workflow creates its resources through generated Cloud Control declarations, uploads an object, receives the event from SQS, and removes the managed resources.
112
-
113
108
  ## Current limits
114
109
 
115
110
  Generated Stripe inputs accept entities at resolved relationship paths. Unresolved targets retain their existing value schemas. AWS entity input generation remains incomplete. The contract permits multi-value request mappings, while the Stripe compiler currently selects one saved output per target. The tracker distinguishes these gaps from unavailable lifecycle operations. [resource mapping tracker](../../attempts/dev-attempts_resource-mapping.md)
@@ -14,7 +14,7 @@ Stripe treats HTTP 404 as confirmed absence. A Customer hint also permits a dele
14
14
 
15
15
  ## Update a resource
16
16
 
17
- An update targets the saved object. Its mapping specifies which output supplies each identity parameter, even if the names differ. The complete request passes validation, including any required constant. If a declaration drops a property, the policy defines how to clear the provider value. Without such a rule, the change fails before mutation.
17
+ An update targets the saved object. Its mapping specifies which output supplies each identity parameter, even if the names differ. Nomoss validates the complete request and any required constants. If a declaration drops a property, the policy defines how to clear the provider value. Without such a rule, the change fails before mutation.
18
18
 
19
19
  Generated Stripe updates currently use the same identity mapping as reads. StripeResourcePolicy returns ResourceCommandUnsupported if the update schema discards a changed field or the declaration drops a saved property. Other identity mappings, constant update values, and provider-specific property resets remain outstanding. A constant that conflicts with the saved identity is invalid.
20
20
 
@@ -22,6 +22,8 @@ Generated Stripe updates currently use the same identity mapping as reads. Strip
22
22
 
23
23
  Removal uses the saved identity. Nomoss releases ownership only after the provider call succeeds. When HTTP DELETE does not express the intended action, a hint selects the operation and any constants its request requires.
24
24
 
25
+ A resource that manages part of a shared provider object removes the entries it owns and preserves unrelated entries. Its management definition identifies those entries and defines how to confirm their removal.
26
+
25
27
  Product and BillingPortalConfiguration use a hint to select POST with active: false for removal. Discovery selects HTTP DELETE by default. Support for each additional removal operation requires an identity mapping and request values the shared service can execute when the declaration disappears.
26
28
 
27
29
  ## Replace a resource
@@ -36,4 +38,4 @@ Each owned instance has its own lifecycle record and protected outputs. A comple
36
38
 
37
39
  Generated configuration preserves the provider operation's input, output, and failure types. Effect infers service dependencies and errors from the application Layer graph. The schema compiler checks mappings and constants, and the runtime validates the completed request.
38
40
 
39
- A generated operation replaces a manual policy once production uses the generated registration and the superseded policy, wrapper, and runtime override are gone. Application integration coverage follows the provider object and its saved identity through each change, checks the values that dependents receive, and exercises recovery and cleanup. Each resource needs executable selections and mappings for its supported operations. [generation specification](generation-architecture.md#provider-directory-organization) · [resource management tracker](../../attempts/dev-attempts_generated-resource-management.md)
41
+ The management definition selects the operations and mappings for each supported change. A provider rule that needs its own decisions or sequence can call a typed operation within the shared lifecycle. An integration case follows the managed object and its saved identity through a change, then checks the outputs that dependents receive and the result of recovery or removal. See the [resource management development guide](../development/effect-native-development.md#develop-resource-management).
@@ -14,18 +14,14 @@ Use Service.operation as the span name. For AWS, the service signing name and AP
14
14
 
15
15
  Downstream spans and events identify the resource by stack, logical id, and provider-qualified type. The service and lifecycle operation stay in scope through reads and persistence. Record the AWS API operation separately so a single resource creation distinguishes CreateResource from each GetResourceRequestStatus poll and the final GetResource.
16
16
 
17
- Planned action counts on the stack span show the scale of the change. Each client span retains the AWS service and operation, from the first request preparation step until the client decodes the response. A request span reports region, HTTP status, and provider request identifier when available. An AWS CLI span identifies the service operation and region and reports the process exit status.
17
+ Planned action counts on the stack span show the scale of the change. Each client span retains the AWS service and operation, from the first request preparation step until the client decodes the response. A request span reports region, HTTP status, and provider request identifier when available.
18
18
 
19
19
  Application annotations exclude resource properties, command arguments, credentials, and uploaded object contents. An optional AWS attribute appears only if the request supplies it.
20
20
 
21
21
  ## Provider waits and retries
22
22
 
23
- Cloud Control events report the provider status and requested retry time. Each poll wait records its actual delay in milliseconds. Nomoss uses the five-second AWS CLI waiter interval so it can detect completion before a later retry timestamp. [AWS CLI waiter interval](https://docs.aws.amazon.com/cli/latest/reference/cloudcontrol/wait/resource-request-success.html)
24
-
25
23
  Each request retry records its attempt, cause, and backoff delay. An operator can compare those events with HTTP spans and provider progress to distinguish transport latency from retry delays and resource stabilization.
26
24
 
27
25
  ## Integration evidence
28
26
 
29
- The S3-to-SQS integration uses the application tracing Layer. Its root span identifies the unique stack and AWS region and stays open through cleanup on success or failure. The trace covers declaration, all three apply passes, reconciliation, notification delivery, teardown, and confirmation of absence.
30
-
31
- Instrumentation changes preserve the integration inputs and assertions. The existing provider and lifecycle tests exercise the workflow. A completed Jaeger trace shows whether the expected spans reached the collector with their parent relationships, resource context, and elapsed times. [observability procedure](../operations/observability-sop.md)
27
+ Instrumentation changes preserve the workflow's inputs and assertions. A completed Jaeger trace shows whether the expected spans reached the collector with their parent relationships, resource context, and elapsed times. [observability procedure](../operations/observability-sop.md)
@@ -12,6 +12,8 @@ Write relationships in complete sentences with articles, verbs, and prepositions
12
12
 
13
13
  ## Explain the decisions that schemas validate
14
14
 
15
+ Give every regular expression its own named declaration beside the code that uses it. Document what the pattern matches, why the caller needs that distinction, and examples of matching and nonmatching input. For a search or replacement, show what happens to the example text. Apply the same rule to expressions emitted by generators so readers of the generated code can understand them at their declaration.
16
+
15
17
  For a schema, explain what the application decides from a value and why its validation matters to that decision. The declaration already shows the fields and their types, so a field catalogue adds no explanation.
16
18
 
17
19
  An output reference lets one resource depend on a provider value that another resource has not yet produced. Explain how the reference expresses that dependency and why the eventual value needs validation. The schema already shows how the reference is represented.
@@ -34,8 +34,52 @@ Use Layer.buildWithMemoMap when the caller must supply a [Layer](https://github.
34
34
 
35
35
  Stop the active stream before its replacement starts. Give each stream its own scope and close that scope to stop it, or store the active fiber in service state and interrupt it directly. Apply that cleanup when a change of identity or runtime requires a new stream.
36
36
 
37
+ ## Develop resource management
38
+
39
+ ### Establish the resource lifecycle
40
+
41
+ Start with what the stack must be able to create, observe, change, replace, and remove. Read the provider specification and trace each action through the existing lifecycle service and saved state. Establish which provider values identify the owned object, which properties can change, what confirms a mutation, and what a retry needs after partial success. See the [resource lifecycle contract](../application/resource-operations.md).
42
+
43
+ Use a branded schema for AWS identities and metadata that pass between services. Decode provider replies and saved values through the canonical schema before a service uses an identity. The brand distinguishes values that share a wire type, such as an AWS account ID and an IAM role ID. Use the [AWS environment and ARN contracts](../../providers/aws/README.md) for account, partition, region, and ARN values.
44
+
45
+ ### Combine generation, declarations, and code
46
+
47
+ Generate schemas and typed client operations from the provider specifications. Use a resource definition to select those operations and map identities, requests, and confirmed results through the shared lifecycle contract. A resource that follows a supported lifecycle should require only its definition and generator inputs. New field names, operation names, and response formats belong in mappings.
48
+
49
+ If the contract lacks a required behavior, explain the provider rule and what happens if the stack omits it. Extend the shared contract if the rule applies to other resources. Supply a typed Effect operation at the affected lifecycle step if a resource needs its own decision or sequence. The shared lifecycle still validates inputs, checks ownership, confirms changes, and saves state. A new interface, manifest field, or renderer requires a distinct behavior that the existing contract cannot express. See [Generate lifecycle operations](../application/generation-architecture.md#generate-lifecycle-operations).
50
+
51
+ ### Resolve management by resource type
52
+
53
+ The provider Layer supplies services shared across resource types. A catalog indexed by resource type can tell the runtime where to find each management definition. Resolve the types a stack operation needs from declarations and saved state. Load and initialize those definitions within the existing application scope. The stack must still manage a saved resource after its declaration disappears. If a definition is missing, report the unsupported command before the runtime sends a request for that resource.
54
+
55
+ A new resource must leave provider runtime composition unchanged. A provider-wide `Layer.mergeAll` of resource command Layers builds every registration at startup. A generated list has the same cost, even if the generator writes one list per service. Keep that pattern out of provider composition. See the [Effect Layer implementation](../../../command-options-fund/refs/effect/packages/effect/src/Layer.ts) for how `mergeAll` builds its inputs.
56
+
57
+ ### Verify the pattern at catalog scale
58
+
59
+ Show that a new resource can use an existing lifecycle through its definition and generator inputs. Run a fixed stack against a catalog of hundreds of resource types and check which management definitions load and initialize. Record the catalog size, the types the stack uses, and the observed startup work. Use the stack to verify mutation results, recovery after a failure, and removal after a declaration disappears.
60
+
61
+ ### Use a local AWS client from another repository
62
+
63
+ Run `yarn install` in the Nomoss checkout. In a Yarn 4 app, add `@tradedal/aws-client-iam` and `@tradedal/aws-client-core` to `dependencies` with `"*"` as the version. Then run this from the app directory:
64
+
65
+ ```sh
66
+ NOMOSS=/path/to/nomoss
67
+ yarn link "$NOMOSS/providers/aws/generated/clients/iam" \
68
+ "$NOMOSS/providers/aws/client-core"
69
+ ```
70
+
71
+ The app imports both packages by name and reads the linked source. If the app uses Yarn's `node-modules` linker, set `NODE_OPTIONS=--preserve-symlinks` when launching it. For an npm app, run `yarn workspace <package-name> pack --out /tmp/<package>.tgz` in Nomoss for each package, then install both archives together with `npm install` from the app. Repack and reinstall to pick up changes.
72
+
37
73
  ## Compose operations and return typed failures
38
74
 
75
+ ### Let Effect infer channels at the call site
76
+
77
+ Let Effect's combinators infer success values, failures, and required services. A helper whose sole purpose is forwarding `Effect.Effect<A, E, R>` to a combinator repeats the library's signature, even when TypeScript infers the helper's return type. The same rule applies to generic Layer inputs.
78
+
79
+ For a retry, the service supplies the schedule and the caller decides which failures to retry with `request.pipe(Effect.retry({ schedule, while: isRetryable }))`. Effect checks the predicate against the request's failure type. Keep a domain type parameter when the signature relates application values, such as a resource observation and its readiness predicate. [Effect retry API and overloads](../../../command-options-fund/refs/effect/packages/effect/src/Effect.ts)
80
+
81
+ ### Keep the complete operation in its Effect
82
+
39
83
  Keep every operation required for a method's result in the Effect returned to its caller. Use explicit Effect sequencing for work that runs after an operation succeeds, such as rendering a plan before returning it. Separate logical steps with blank lines so readers can see where the operation obtains the result, uses it, and returns it. Perform external I/O and process execution through Effect services so the application supplies their implementations and controls their lifetimes. Send program logs through Effect and terminal output through the command renderer that applies the CLI's presentation contract.
40
84
 
41
85
  Represent provider rejections, transport failures, and invalid responses with Data.TaggedError. Include the affected resource or operation and the provider's failure details so callers can identify the failed work. Decode modeled provider errors through generated contracts, and translate transport and validation failures in internal services into the tagged errors promised by their public methods.