build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
|
|
import '../tool/src/check_files.dart';
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
test("our own Dart files are formatted: the apps', the shared packages', the "
|
|
|
|
|
"tools'", () {
|
|
|
|
|
for (final path in [
|
|
|
|
|
'apps/learn/halkyon_learn_flutter/lib/main.dart',
|
|
|
|
|
'apps/learn/halkyon_learn_server/lib/server.dart',
|
|
|
|
|
'apps/learn/halkyon_learn_server/test/integration/auth/account_test.dart',
|
|
|
|
|
'apps/todo/halkyon_todo_flutter/lib/main.dart',
|
|
|
|
|
'packages/halkyon_app/lib/halkyon_app.dart',
|
|
|
|
|
'packages/halkyon_base_server/lib/src/auth/email.dart',
|
feat(crypto): SRP-6a, the register's half and the device's
ADR 0017's step 1. Generic over group and hash (SrpGroup); production
takes RFC 5054's 3072-bit group with SHA-256. k = H(N | PAD(g)),
u = H(PAD(A) | PAD(B)), K = H(PAD(S)),
M1 = H(H(N) xor H(g) | H(I) | s | PAD(A) | PAD(B) | K),
M2 = H(PAD(A) | M1 | K). A and B must lie in 1..N-1 and u must not be
0; a and b are 256 bits from Random.secure(); proofs are compared in
constant time. x comes from the caller (halkyon_keys makes it); RFC
5054's own x is there for the vectors only.
- The register's half in halkyon_base_server (base.dart: srpChallenge,
srpVerify), the device's written by hand in halkyon_base_client
(srp.dart: SrpClient, srpVerifier). Serverpod's generator cleans and
writes only a client's lib/src/protocol/ (serverpod_cli 4.0.4's
_getDirectoriesRequiringCleaning; a generate leaves srp/ untouched).
- Tests: RFC 5054 Appendix B on both halves; the client against the
register, succeeding and every refusal.
- The module's tests depend on its client, and pub resolves every
member's dev dependencies, so Learn's server image takes the module's
client into its workspace too.
- The format check covers the hand-written half.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-20 12:01:52 +02:00
|
|
|
// SRP's client half, written by hand beside the module's generated
|
|
|
|
|
// client, and its tests.
|
|
|
|
|
'packages/halkyon_base_client/lib/srp.dart',
|
|
|
|
|
'packages/halkyon_base_client/lib/src/srp/srp_client.dart',
|
|
|
|
|
'packages/halkyon_base_client/test/srp_client_test.dart',
|
|
|
|
|
'packages/halkyon_keys/lib/src/account_keys.dart',
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
'tool/check.dart',
|
|
|
|
|
]) {
|
|
|
|
|
expect(isOwnDartFile(path), isTrue, reason: path);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('what a generator writes is left as it wrote it', () {
|
|
|
|
|
for (final path in [
|
feat(crypto): SRP-6a, the register's half and the device's
ADR 0017's step 1. Generic over group and hash (SrpGroup); production
takes RFC 5054's 3072-bit group with SHA-256. k = H(N | PAD(g)),
u = H(PAD(A) | PAD(B)), K = H(PAD(S)),
M1 = H(H(N) xor H(g) | H(I) | s | PAD(A) | PAD(B) | K),
M2 = H(PAD(A) | M1 | K). A and B must lie in 1..N-1 and u must not be
0; a and b are 256 bits from Random.secure(); proofs are compared in
constant time. x comes from the caller (halkyon_keys makes it); RFC
5054's own x is there for the vectors only.
- The register's half in halkyon_base_server (base.dart: srpChallenge,
srpVerify), the device's written by hand in halkyon_base_client
(srp.dart: SrpClient, srpVerifier). Serverpod's generator cleans and
writes only a client's lib/src/protocol/ (serverpod_cli 4.0.4's
_getDirectoriesRequiringCleaning; a generate leaves srp/ untouched).
- Tests: RFC 5054 Appendix B on both halves; the client against the
register, succeeding and every refusal.
- The module's tests depend on its client, and pub resolves every
member's dev dependencies, so Learn's server image takes the module's
client into its workspace too.
- The format check covers the hand-written half.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-20 12:01:52 +02:00
|
|
|
// The client packages, Serverpod's from top to bottom, but for the
|
|
|
|
|
// module's SRP.
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
'apps/learn/halkyon_learn_client/lib/src/protocol/client.dart',
|
|
|
|
|
'apps/todo/halkyon_todo_client/lib/halkyon_todo_client.dart',
|
|
|
|
|
'packages/halkyon_base_client/lib/src/protocol/protocol.dart',
|
feat(crypto): SRP-6a, the register's half and the device's
ADR 0017's step 1. Generic over group and hash (SrpGroup); production
takes RFC 5054's 3072-bit group with SHA-256. k = H(N | PAD(g)),
u = H(PAD(A) | PAD(B)), K = H(PAD(S)),
M1 = H(H(N) xor H(g) | H(I) | s | PAD(A) | PAD(B) | K),
M2 = H(PAD(A) | M1 | K). A and B must lie in 1..N-1 and u must not be
0; a and b are 256 bits from Random.secure(); proofs are compared in
constant time. x comes from the caller (halkyon_keys makes it); RFC
5054's own x is there for the vectors only.
- The register's half in halkyon_base_server (base.dart: srpChallenge,
srpVerify), the device's written by hand in halkyon_base_client
(srp.dart: SrpClient, srpVerifier). Serverpod's generator cleans and
writes only a client's lib/src/protocol/ (serverpod_cli 4.0.4's
_getDirectoriesRequiringCleaning; a generate leaves srp/ untouched).
- Tests: RFC 5054 Appendix B on both halves; the client against the
register, succeeding and every refusal.
- The module's tests depend on its client, and pub resolves every
member's dev dependencies, so Learn's server image takes the module's
client into its workspace too.
- The format check covers the hand-written half.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-20 12:01:52 +02:00
|
|
|
'packages/halkyon_base_client/lib/halkyon_base_client.dart',
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
// A server's generated sources and test tools.
|
|
|
|
|
'apps/learn/halkyon_learn_server/lib/src/generated/protocol.dart',
|
|
|
|
|
'packages/halkyon_base_server/lib/src/generated/endpoints.dart',
|
|
|
|
|
'apps/learn/halkyon_learn_server/test/integration/test_tools/serverpod_test_tools.dart',
|
|
|
|
|
// gen-l10n's localizations, the app's and the shared packages'.
|
|
|
|
|
'apps/learn/halkyon_learn_flutter/lib/l10n/app_localizations.dart',
|
|
|
|
|
'apps/learn/halkyon_learn_flutter/lib/l10n/app_localizations_de.dart',
|
|
|
|
|
'packages/halkyon_ui/lib/l10n/halkyon_ui_localizations_en.dart',
|
|
|
|
|
'packages/halkyon_app/lib/l10n/halkyon_app_localizations.dart',
|
|
|
|
|
]) {
|
|
|
|
|
expect(isOwnDartFile(path), isFalse, reason: path);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('the files of other languages are no Dart files', () {
|
|
|
|
|
expect(isOwnDartFile('apps/learn/tool/app_icons.py'), isFalse);
|
|
|
|
|
expect(
|
|
|
|
|
isOwnDartFile('packages/halkyon_app/lib/l10n/halkyon_app_en.arb'),
|
|
|
|
|
isFalse,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2026-10-19 21:32:14 +02:00
|
|
|
group('what changed since a commit', () {
|
|
|
|
|
const packages = {
|
|
|
|
|
'halkyon_app': 'packages/halkyon_app',
|
|
|
|
|
'halkyon_ui': 'packages/halkyon_ui',
|
|
|
|
|
'halkyon_ui_example': 'packages/halkyon_ui/example',
|
|
|
|
|
'halkyon_learn_flutter': 'apps/learn/halkyon_learn_flutter',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
test('touches the packages its files are in, the innermost one', () {
|
|
|
|
|
expect(
|
|
|
|
|
packagesTouched([
|
|
|
|
|
'packages/halkyon_app/lib/src/app/app_frame.dart',
|
|
|
|
|
'packages/halkyon_app/test/app/instance_gate_test.dart',
|
|
|
|
|
'packages/halkyon_ui/example/lib/main.dart',
|
|
|
|
|
], packages),
|
|
|
|
|
['halkyon_app', 'halkyon_ui_example'],
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("files of no package (docs, tools, deploy) touch none: the tools' "
|
|
|
|
|
'own tests run anyway', () {
|
|
|
|
|
expect(
|
|
|
|
|
packagesTouched([
|
|
|
|
|
'docs/adr/0015-one-repository.md',
|
|
|
|
|
'tool/check.dart',
|
|
|
|
|
'deploy/compose.yaml',
|
|
|
|
|
], packages),
|
|
|
|
|
isEmpty,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("the root's pubspec, lock or lint rules touch every package", () {
|
|
|
|
|
for (final path in [
|
|
|
|
|
'pubspec.yaml',
|
|
|
|
|
'pubspec.lock',
|
|
|
|
|
'analysis_options.yaml',
|
|
|
|
|
]) {
|
|
|
|
|
expect(packagesTouched([path], packages), isNull, reason: path);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("Melos' filters take every package, or those touched and what "
|
|
|
|
|
'depends on them', () {
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
expect(melosFilters(), isEmpty);
|
2026-10-19 21:32:14 +02:00
|
|
|
expect(melosFilters(touched: ['halkyon_app', 'halkyon_ui']), [
|
|
|
|
|
'--scope=halkyon_app',
|
|
|
|
|
'--scope=halkyon_ui',
|
build: Melos, a Dart check and every path for the single repository
- Melos 8.9 as the root's dev dependency, with scripts across the
workspace (analyze, test:dart, test:flutter, generate, check) and its
filters (--diff, --include-dependents); cli_util overridden to 0.5.2
for it, since Learn's flutter_launcher_icons asks for 0.4 and uses only
its logger, unchanged in 0.5.
- tool/check.dart in place of tool/check.sh: packages, formatting of our
own files, analysis, the tools' tests, then every package's tests
through Melos (--changed-since=<commit> for only what changed and what
depends on it). tool/pre-push is the hook: the signature check, then
the checks. CI generates every server's code and runs the same check.
- The images build from the root with a workspace narrowed to what they
need (tool/workspace_only.sh); compose, the deploy's migration test,
the snap, the release script, the editor's launch files and Learn's
asset tools (run from apps/learn) follow the new layout.
- The project's source is named as project-halkyon/halkyon (source link,
snap, F-Droid listing, release uploads); the AGPL packages carry the
licence's own text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-10-19 20:39:09 +02:00
|
|
|
'--include-dependents',
|
|
|
|
|
]);
|
|
|
|
|
});
|
|
|
|
|
}
|